File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ program
115
115
program
116
116
. command ( 'ui' )
117
117
. description ( 'start and open the vue-cli ui' )
118
+ . option ( '-H, --host <host>' , 'Host used for the UI server (default: localhost)' )
118
119
. option ( '-p, --port <port>' , 'Port used for the UI server (by default search for available port)' )
119
120
. option ( '-D, --dev' , 'Run in dev mode' )
120
121
. option ( '--quiet' , `Don't output starting messages` )
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ const { portfinder, server } = require('@vue/cli-ui/server')
3
3
const shortid = require ( 'shortid' )
4
4
5
5
async function ui ( options = { } , context = process . cwd ( ) ) {
6
+ const host = options . host || 'localhost'
7
+
6
8
let port = options . port
7
9
if ( ! port ) {
8
10
port = await portfinder . getPortPromise ( )
@@ -28,6 +30,7 @@ async function ui (options = {}, context = process.cwd()) {
28
30
if ( ! options . quiet ) log ( `🚀 Starting GUI...` )
29
31
30
32
const opts = {
33
+ host,
31
34
port,
32
35
graphqlPath : '/graphql' ,
33
36
subscriptionsPath : '/graphql' ,
@@ -55,7 +58,7 @@ async function ui (options = {}, context = process.cwd()) {
55
58
}
56
59
57
60
// Open browser
58
- const url = `http://localhost :${ port } `
61
+ const url = `http://${ host } :${ port } `
59
62
if ( ! options . quiet ) log ( `🌠 Ready on ${ url } ` )
60
63
if ( options . headless ) {
61
64
console . log ( port )
You can’t perform that action at this time.
0 commit comments