Vue-cli: Allow customisation of IP address when using Vue UI

Created on 2 Oct 2018  路  4Comments  路  Source: vuejs/vue-cli

What problem does this feature solve?

At the moment the command line only allows customisation of port number, not host/IP address. Because it is fixed to 'localhost', when running from within a docker container running on a VM (docker machine), I cannot access it (I need to change it to 0.0.0.0:8000).

What does the proposed API look like?

vue ui -h 0.0.0.0

enhancement ui

Most helpful comment

The --host option was merged in #2568 and should resolve this.

All 4 comments

as a dirty work around: run this somewhere (eg: Dockerfile, entrypoint) before running vue ui:

sed -i 's/subscriptionsPath/host: "0.0.0.0", subscriptionsPath/' /usr/local/share/.config/yarn/global/node_modules/@vue/cli/lib/ui.js

Nice, thanks.

FYI when installed via NPM, is located at /usr/local/lib/node_modules/@vue/cli/lib/ui.js

Will see if I get time in the coming weeks to implement this feature properly in a PR now that I know where to look.

thanks @mathroc and @assembledadam!

docker example for npm:

RUN npm install -g @vue/cli; \
  sed -i 's/subscriptionsPath/host: "0.0.0.0", subscriptionsPath/' /usr/local/lib/node_modules/@vue/cli/lib/ui.js

The --host option was merged in #2568 and should resolve this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgribonvald picture jgribonvald  路  3Comments

chasegiunta picture chasegiunta  路  3Comments

joshuajohnson814 picture joshuajohnson814  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments