fix(web): fix dev-server deprecation warning (#10203)

This  PR will resolve deprecation warning:
(node:62713) [DEP_WEBPACK_DEV_SERVER_HTTPS] DeprecationWarning: 'https' option is deprecated. Please use the 'server' option.
This commit is contained in:
Nikola 2022-05-30 21:58:18 +02:00 committed by GitHub
parent 85b185752c
commit daddcde73c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,6 @@ function getDevServerPartial(
open: options.open, open: options.open,
static: false, static: false,
compress: scriptsOptimization || stylesOptimization, compress: scriptsOptimization || stylesOptimization,
https: options.ssl,
devMiddleware: { devMiddleware: {
publicPath: servePath, publicPath: servePath,
stats: false, stats: false,
@ -109,8 +108,13 @@ function getDevServerPartial(
hot: options.hmr, hot: options.hmr,
}; };
if (options.ssl && options.sslKey && options.sslCert) { if (options.ssl) {
config.https = getSslConfig(root, options); config.server = {
type: 'https',
};
if (options.sslKey && options.sslCert) {
config.server.options = getSslConfig(root, options);
}
} }
if (options.proxyConfig) { if (options.proxyConfig) {