diff --git a/packages/@vuepress/core/lib/node/dev/index.js b/packages/@vuepress/core/lib/node/dev/index.js index 224de1707a..0fb08d6783 100644 --- a/packages/@vuepress/core/lib/node/dev/index.js +++ b/packages/@vuepress/core/lib/node/dev/index.js @@ -175,7 +175,8 @@ module.exports = class DevProcess extends EventEmitter { port: this.port, displayHost: this.displayHost, publicPath: this.context.base, - clearScreen: !(this.context.options.debug || !this.context.options.clearScreen) + clearScreen: !(this.context.options.debug || !this.context.options.clearScreen), + isHttps: (this.context.siteConfig.devServer || {}).https }]) config = config.toConfig() diff --git a/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js b/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js index 1c9c4af5c9..97feefa7ce 100644 --- a/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js +++ b/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js @@ -17,7 +17,7 @@ module.exports = class DevLogPlugin { apply (compiler) { let isFirst = true - const { displayHost, port, publicPath, clearScreen: shouldClearScreen } = this.options + const { displayHost, port, publicPath, clearScreen: shouldClearScreen, isHttps } = this.options compiler.hooks.done.tap('vuepress-log', stats => { if (shouldClearScreen) { @@ -25,7 +25,7 @@ module.exports = class DevLogPlugin { } const time = new Date().toTimeString().match(/^[\d:]+/)[0] - const displayUrl = `http://${displayHost}:${port}${publicPath}` + const displayUrl = `http${isHttps ? 's' : ''}://${displayHost}:${port}${publicPath}` logger.success( `${chalk.gray(`[${time}]`)} Build ${chalk.italic(stats.hash.slice(0, 6))} `