Skip to content

Commit f7c87d8

Browse files
authored
Merge pull request #190 from millerds/fix-webpack-deprecation
Update webpack config to use 'server' option
2 parents 3e43417 + 3655898 commit f7c87d8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/end-to-end/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const webpack = require("webpack");
88

99
async function getHttpsOptions() {
1010
const httpsOptions = await devCerts.getHttpsServerOptions();
11-
return { cacert: httpsOptions.ca, key: httpsOptions.key, cert: httpsOptions.cert };
11+
return { ca: httpsOptions.ca, key: httpsOptions.key, cert: httpsOptions.cert };
1212
}
1313

1414
module.exports = async (env, options) => {
@@ -87,7 +87,10 @@ module.exports = async (env, options) => {
8787
headers: {
8888
"Access-Control-Allow-Origin": "*",
8989
},
90-
https: env.WEBPACK_BUILD || options.https !== undefined ? options.https : await getHttpsOptions(),
90+
server: {
91+
type: "https",
92+
options: env.WEBPACK_BUILD || options.https !== undefined ? options.https : await getHttpsOptions(),
93+
},
9194
port: process.env.npm_package_config_dev_server_port || 3000,
9295
},
9396
};

webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DE
99

1010
async function getHttpsOptions() {
1111
const httpsOptions = await devCerts.getHttpsServerOptions();
12-
return { cacert: httpsOptions.ca, key: httpsOptions.key, cert: httpsOptions.cert };
12+
return { ca: httpsOptions.ca, key: httpsOptions.key, cert: httpsOptions.cert };
1313
}
1414

1515
module.exports = async (env, options) => {
@@ -93,7 +93,10 @@ module.exports = async (env, options) => {
9393
headers: {
9494
"Access-Control-Allow-Origin": "*",
9595
},
96-
https: env.WEBPACK_BUILD || options.https !== undefined ? options.https : await getHttpsOptions(),
96+
server: {
97+
type: "https",
98+
options: env.WEBPACK_BUILD || options.https !== undefined ? options.https : await getHttpsOptions(),
99+
},
97100
port: process.env.npm_package_config_dev_server_port || 3000,
98101
},
99102
};

0 commit comments

Comments
 (0)