Fix warning shown when running npm run serve
(node:2671539) [DEP_WEBPACK_DEV_SERVER_HTTPS] DeprecationWarning:
'https' option is deprecated. Please use the 'server' option.
(Use `node --trace-deprecation ...` to show where the warning was
created)
Added a new environment flag called DEV_HTTPS. Set it to true to
run the app with HTTPS (useful for testing secure-only features
or using a signed certificate)
Ref: https://webpack.js.org/configuration/dev-server/#devserverserver
Change-Id: I31d27b04488923be58514499234286fa89b4d03b
Signed-off-by: Hariharan Rangasamy <hariharanr@ami.com>
diff --git a/vue.config.js b/vue.config.js
index 2fab59f..52820ab 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -27,7 +27,10 @@
},
},
devServer: {
- https: true,
+ // Set DEV_HTTPS=true to run with HTTPS (helpful for testing secure-only features or with a signed cert)
+ // ref https://webpack.js.org/configuration/dev-server/#devserverserver
+ server:
+ process.env.DEV_HTTPS === 'true' ? { type: 'https' } : { type: 'http' },
proxy: {
'/': {
target: process.env.BASE_URL,