Skip to content

Commit 550317e

Browse files
Dmitriy Sharshakov aka. sh7dmulivz
Dmitriy Sharshakov aka. sh7dm
authored andcommitted
feat(core): add --open argument to open browser automatically (close: #1100)(#1109)
1 parent 7ad0a42 commit 550317e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/@vuepress/core/lib/dev.js

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ module.exports = async function dev (sourceDir, cliOptions = {}) {
121121
},
122122
logLevel: 'error',
123123
port,
124+
open: cliOptions.open,
124125
add: app => {
125126
// apply plugin options to extend dev server.
126127
ctx.pluginAPI.options.enhanceDevServer.syncApply(app)

packages/vuepress/lib/registerCoreCommands.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = function (cli, options) {
2222
.option('--no-cache', 'clean the cache before build')
2323
.option('--debug', 'start development server in debug mode')
2424
.option('--silent', 'start development server in silent mode')
25+
.option('--open', 'open browser when ready')
2526
.action((sourceDir = '.', commandOptions) => {
2627
const { debug, silent } = commandOptions
2728

0 commit comments

Comments
 (0)