mirror of https://github.com/zulip/zulip.git
webpack: Fix run-dev.py --minify.
‘--optimize-minimize’ no longer exists. (Webpack 5 has ‘--optimization-minimize’.) Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
17fe09bb6d
commit
9f3d1fdbdb
|
@ -38,7 +38,7 @@ def build_for_dev_server(host: str, port: str, minify: bool, disable_host_check:
|
|||
"--hot",
|
||||
]
|
||||
if minify:
|
||||
webpack_args.append("--optimize-minimize")
|
||||
webpack_args.append("--env=minimize")
|
||||
if disable_host_check:
|
||||
webpack_args.append("--disable-host-check")
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ const cacheLoader: webpack.RuleSetUseItem = {
|
|||
},
|
||||
};
|
||||
|
||||
export default (_env: unknown, argv: {mode?: string}): webpack.Configuration[] => {
|
||||
export default (env: {minimize?: boolean} = {}, argv: {mode?: string}): webpack.Configuration[] => {
|
||||
const production: boolean = argv.mode === "production";
|
||||
|
||||
const config: webpack.Configuration = {
|
||||
|
@ -177,6 +177,7 @@ export default (_env: unknown, argv: {mode?: string}): webpack.Configuration[] =
|
|||
// the source snippets with the eval-* options.
|
||||
devtool: production ? "source-map" : "cheap-module-source-map",
|
||||
optimization: {
|
||||
minimize: env.minimize ?? production,
|
||||
minimizer: [
|
||||
new CssMinimizerPlugin({
|
||||
sourceMap: true,
|
||||
|
|
Loading…
Reference in New Issue