Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tip after the server has started #130

Merged
merged 2 commits into from
Apr 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) {
}

const compiler = webpack(config)
const host = cliOptions.host || options.siteConfig.host || '0.0.0.0'
portfinder.basePort = cliOptions.port || options.siteConfig.port || 8080
const port = await portfinder.getPortPromise()

Expand All @@ -82,7 +83,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) {
isFirst = false
console.log(
`\n VuePress dev server listening at ${
chalk.cyan(`http://localhost:${port}${options.publicPath}`)
chalk.cyan(`http://${host}:${port}${options.publicPath}`)
}\n`
)
} else {
Expand All @@ -97,7 +98,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) {
// in cwd it would break the server
content: [nonExistentDir],
compiler,
host: cliOptions.host || options.siteConfig.host || '0.0.0.0',
host,
dev: { logLevel: 'warn' },
hot: { logLevel: 'error' },
logLevel: 'error',
Expand Down