dependencies: Upgrade webpack-dev-server to 4.2.0.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-09-10 12:28:29 -07:00
committed by Tim Abbott
parent 2fe1ece3a6
commit 04075201a0
5 changed files with 512 additions and 471 deletions

View File

@@ -92,8 +92,8 @@
"@types/node": "^14.0.11", "@types/node": "^14.0.11",
"@types/node-fetch": "^2.5.8", "@types/node-fetch": "^2.5.8",
"@types/terser-webpack-plugin": "^4.1.0", "@types/terser-webpack-plugin": "^4.1.0",
"@types/webpack": "^4.4.32", "@types/webpack": "^4.41.31",
"@types/webpack-dev-server": "^3.1.6", "@types/webpack-dev-server": "^4.1.0",
"@types/zxcvbn": "^4.4.1", "@types/zxcvbn": "^4.4.1",
"@typescript-eslint/eslint-plugin": "^4.0.1", "@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1", "@typescript-eslint/parser": "^4.0.1",
@@ -123,7 +123,7 @@
"ts-node": "^10.0.0", "ts-node": "^10.0.0",
"typescript": "^4.0.2", "typescript": "^4.0.2",
"vnu-jar": "^21.2.5", "vnu-jar": "^21.2.5",
"webpack-dev-server": "^3.5.1", "webpack-dev-server": "^4.2.0",
"xvfb": "^0.4.0", "xvfb": "^0.4.0",
"yaml": "^2.0.0-8", "yaml": "^2.0.0-8",
"yargs": "^15.0.2", "yargs": "^15.0.2",

View File

@@ -28,7 +28,6 @@ def build_for_dev_server(host: str, port: str, minify: bool, disable_host_check:
# webpack-cli has a bug where it ignores --watch-poll with # webpack-cli has a bug where it ignores --watch-poll with
# multi-config, and we don't need the katex-cli part anyway. # multi-config, and we don't need the katex-cli part anyway.
"--config-name=frontend", "--config-name=frontend",
"--allowed-hosts=" + ",".join([host, ".zulipdev.com", ".zulipdev.org"]),
f"--host={host}", f"--host={host}",
f"--port={port}", f"--port={port}",
# We add the hot flag using the cli because it takes care # We add the hot flag using the cli because it takes care
@@ -39,7 +38,9 @@ def build_for_dev_server(host: str, port: str, minify: bool, disable_host_check:
if minify: if minify:
webpack_args.append("--env=minimize") webpack_args.append("--env=minimize")
if disable_host_check: if disable_host_check:
webpack_args.append("--disable-host-check") webpack_args.append("--allowed-hosts=all")
else:
webpack_args.append("--allowed-hosts=" + ",".join([host, ".zulipdev.com", ".zulipdev.org"]))
# Tell webpack-dev-server to fall back to periodic polling on # Tell webpack-dev-server to fall back to periodic polling on
# filesystems where inotify is known to be broken. # filesystems where inotify is known to be broken.

View File

@@ -48,4 +48,4 @@ API_FEATURE_LEVEL = 97
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = "157.2" PROVISION_VERSION = "158.0"

View File

@@ -210,16 +210,6 @@ export default (env: {minimize?: boolean} = {}, argv: {mode?: string}): webpack.
}, },
}, },
plugins: [ plugins: [
new webpack.ProgressPlugin({
handler(percentage) {
if (percentage === 1) {
console.log(
"\u001B[34mi 「wdm」\u001B[0m:",
"Webpack compilation successful.",
);
}
},
}),
new DebugRequirePlugin(), new DebugRequirePlugin(),
new BundleTracker({ new BundleTracker({
filename: production filename: production
@@ -247,21 +237,24 @@ export default (env: {minimize?: boolean} = {}, argv: {mode?: string}): webpack.
}), }),
], ],
devServer: { devServer: {
clientLogLevel: "error", devMiddleware: {
publicPath: "/webpack/",
stats: "errors-only",
},
headers: { headers: {
"Access-Control-Allow-Origin": "*", "Access-Control-Allow-Origin": "*",
}, },
publicPath: "/webpack/", },
stats: "errors-only", infrastructureLogging: {
noInfo: true, level: "warn",
watchOptions: { },
ignored: [ watchOptions: {
"**/node_modules/**", ignored: [
// Prevent Emacs file locks from crashing webpack-dev-server "**/node_modules/**",
// https://github.com/webpack/webpack-dev-server/issues/2821 // Prevent Emacs file locks from crashing webpack-dev-server
"**/.#*", // https://github.com/webpack/webpack-dev-server/issues/2821
], "**/.#*",
}, ],
}, },
}; };

933
yarn.lock

File diff suppressed because it is too large Load Diff