Skip to content

Commit

Permalink
feat(core): add --open argument to open browser automatically (close: #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Sharshakov aka. sh7dm authored and ulivz committed Dec 17, 2018
1 parent 7ad0a42 commit 550317e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/@vuepress/core/lib/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) {
},
logLevel: 'error',
port,
open: cliOptions.open,
add: app => {
// apply plugin options to extend dev server.
ctx.pluginAPI.options.enhanceDevServer.syncApply(app)
Expand Down
1 change: 1 addition & 0 deletions packages/vuepress/lib/registerCoreCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = function (cli, options) {
.option('--no-cache', 'clean the cache before build')
.option('--debug', 'start development server in debug mode')
.option('--silent', 'start development server in silent mode')
.option('--open', 'open browser when ready')
.action((sourceDir = '.', commandOptions) => {
const { debug, silent } = commandOptions

Expand Down

0 comments on commit 550317e

Please sign in to comment.