Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I bind `vue ui` to another IP? (vue-cli 3)

Tags:

vue-cli

I'm using vue-cli in docker, and it's necessary to bind services to the LAN IP, or to 0.0.0.0 in order to access them 'locally'.

I expected --host 0.0.0.0, but that's not there.

$ vue ui šŸš€ Starting GUI... šŸŒ  Ready on http://localhost:8000

$ vue ui -h Usage: ui [options] start and open the vue-cli ui Options: -p, --port <port> Port used for the UI server (by default search for awailable port) -D, --dev Run in dev mode --quiet Don't output starting messages --headless Don't open browser on start and output port -h, --help output usage information

like image 374
joshfindit Avatar asked Jul 09 '18 16:07

joshfindit


1 Answers

I'm using Vue.js inside a Vagrant instance for development and had the same issue initially.

It looks like the -H / --host option was added in vue-cli version 3.1.0: https://github.com/vuejs/vue-cli/pull/2568

$ vue --version
3.1.3

$ vue ui -h
Usage: ui [options]

start and open the vue-cli ui

Options:
  -H, --host <host>  Host used for the UI server (default: localhost)
  -p, --port <port>  Port used for the UI server (by default search for available port)
  -D, --dev          Run in dev mode
  --quiet            Don't output starting messages
  --headless         Don't open browser on start and output port
  -h, --help         output usage information

$ vue ui -H 0.0.0.0
šŸš€  Starting GUI...
šŸŒ   Ready on http://0.0.0.0:8000

This solved my issue.

like image 186
Rohan Talip Avatar answered Nov 03 '22 22:11

Rohan Talip