Skip to content

Commit

Permalink
chore(deps-dev): bump webpack-dev-server from 4.15.1 to 5.0.2 (#10543)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump webpack-dev-server from 4.15.1 to 5.0.2
* refactor(webpack-dev-server): migrate {https => server} option
* refactor(webpack-dev-server): migrate {close => stopCallback}() method

Co-authored-by: Claas Augner <caugner@mozilla.com>
  • Loading branch information
dependabot[bot] and caugner authored Feb 26, 2024
1 parent c76d886 commit 4c8bbf7
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 132 deletions.
11 changes: 7 additions & 4 deletions client/config/getHttpsConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ function getHttpsConfig() {
if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
const config = {
const options = {
cert: readEnvFile(crtFile, "SSL_CRT_FILE"),
key: readEnvFile(keyFile, "SSL_KEY_FILE"),
};

validateKeyAndCerts({ ...config, keyFile, crtFile });
return config;
validateKeyAndCerts({ ...options, keyFile, crtFile });
return {
type: "https",
options,
};
}
return isHttps;
return isHttps ? "https" : "http";
}

export default getHttpsConfig;
5 changes: 2 additions & 3 deletions client/config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ignoredFiles from "react-dev-utils/ignoredFiles.js";
import redirectServedPath from "react-dev-utils/redirectServedPathMiddleware.js";

import paths from "./paths.js";
import getHttpsConfig from "./getHttpsConfig.js";
import getServerConfig from "./getHttpsConfig.js";

const host = process.env.HOST || "0.0.0.0";
const sockHost = process.env.WDS_SOCKET_HOST;
Expand Down Expand Up @@ -93,8 +93,7 @@ function config(proxy, allowedHost) {
// remove last slash so user can land on `/test` instead of `/test/`
publicPath: paths.publicUrlOrPath.slice(0, -1),
},

https: getHttpsConfig(),
server: getServerConfig(),
host,
historyApiFallback: {
// Paths with dots should still use the history fallback.
Expand Down
6 changes: 2 additions & 4 deletions client/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,14 @@ checkBrowsers(paths.appPath, isInteractive)

["SIGINT", "SIGTERM"].forEach(function (sig) {
process.on(sig, function () {
devServer.close();
process.exit();
devServer.stopCallback(() => process.exit());
});
});

if (process.env.CI !== "true") {
// Gracefully exit when stdin ends
process.stdin.on("end", function () {
devServer.close();
process.exit();
devServer.stopCallback(() => process.exit());
});
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"typescript": "^5.1.6",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-dev-server": "^5.0.2",
"webpack-manifest-plugin": "^5.0.0",
"webpack-node-externals": "^3.0.0",
"workbox-webpack-plugin": "^7.0.0"
Expand Down
Loading

0 comments on commit 4c8bbf7

Please sign in to comment.