Skip to content

Commit 39896c2

Browse files
authored
conditionally set displayUrl to https
Originally, the `displayUrl` output in log messages was hard-coded to be `http`. Now it is set to `https` if the `isHttps` value passed in via `options` is truthy.
1 parent 72f93b6 commit 39896c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ module.exports = class DevLogPlugin {
1717

1818
apply (compiler) {
1919
let isFirst = true
20-
const { displayHost, port, publicPath, clearScreen: shouldClearScreen } = this.options
20+
const { displayHost, port, publicPath, clearScreen: shouldClearScreen, isHttps } = this.options
2121

2222
compiler.hooks.done.tap('vuepress-log', stats => {
2323
if (shouldClearScreen) {
2424
clearScreen()
2525
}
2626

2727
const time = new Date().toTimeString().match(/^[\d:]+/)[0]
28-
const displayUrl = `http://${displayHost}:${port}${publicPath}`
28+
const displayUrl = `http${isHttps ? 's' : ''}://${displayHost}:${port}${publicPath}`
2929

3030
logger.success(
3131
`${chalk.gray(`[${time}]`)} Build ${chalk.italic(stats.hash.slice(0, 6))} `

0 commit comments

Comments
 (0)