Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@vue/cli/bin/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ program
program
.command('ui')
.description('start and open the vue-cli ui')
.option('-H, --host <host>', 'Host used for the UI server (default: localhost)')
.option('-p, --port <port>', 'Port used for the UI server (by default search for available port)')
.option('-D, --dev', 'Run in dev mode')
.option('--quiet', `Don't output starting messages`)
Expand Down
5 changes: 4 additions & 1 deletion packages/@vue/cli/lib/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const { portfinder, server } = require('@vue/cli-ui/server')
const shortid = require('shortid')

async function ui (options = {}, context = process.cwd()) {
const host = options.host || 'localhost'

let port = options.port
if (!port) {
port = await portfinder.getPortPromise()
Expand All @@ -28,6 +30,7 @@ async function ui (options = {}, context = process.cwd()) {
if (!options.quiet) log(`🚀 Starting GUI...`)

const opts = {
host,
port,
graphqlPath: '/graphql',
subscriptionsPath: '/graphql',
Expand Down Expand Up @@ -55,7 +58,7 @@ async function ui (options = {}, context = process.cwd()) {
}

// Open browser
const url = `http://localhost:${port}`
const url = `http://${host}:${port}`
if (!options.quiet) log(`🌠 Ready on ${url}`)
if (options.headless) {
console.log(port)
Expand Down