diff --git a/src/commands/watch.js b/src/commands/watch.js index c3c2bb7a3..b03e7edd1 100644 --- a/src/commands/watch.js +++ b/src/commands/watch.js @@ -43,7 +43,7 @@ export default asyncCommand({ async handler(argv) { argv.production = false; - if (argv.https) { + if (argv.https || process.env.HTTPS) { let ssl = await getSslCert(); if (!ssl) { ssl = true; diff --git a/src/lib/webpack/run-webpack.js b/src/lib/webpack/run-webpack.js index ae22bff69..c6cce632d 100644 --- a/src/lib/webpack/run-webpack.js +++ b/src/lib/webpack/run-webpack.js @@ -41,7 +41,7 @@ const devBuild = async (env, onprogress) => { compiler.plugin('done', stats => { let devServer = config.devServer; - let protocol = devServer.https ? 'https' : 'http'; + let protocol = (process.env.HTTPS || devServer.https) ? 'https' : 'http'; let host = process.env.HOST || devServer.host || 'localhost'; let serverAddr = `${protocol}://${host === '0.0.0.0' ? 'localhost' : host}:${chalk.bold(port)}`;