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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With