Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
webpack: Use Webpack’s mode option rather than repurposing env.
Anders Kaseorgf644bf20638f
diff --git a/tools/webpack b/tools/webpackindex 18891489caf..7a4c9618b4d 100755--- a/tools/webpack+++ b/tools/webpack@@ -12,9 +12,7 @@ STATIC_PATH = 'static/'def build_for_prod_or_puppeteer(quiet: bool) -> NoReturn:"""Builds for production, writing the output to disk"""- webpack_args = ['node', 'node_modules/.bin/webpack-cli',- '-p',- '--env=production']+ webpack_args = ['node', 'node_modules/.bin/webpack-cli', '-p']if quiet:webpack_args.append('--display=errors-only')os.execvp(webpack_args[0], webpack_args)diff --git a/webpack.config.ts b/webpack.config.tsindex 269af93957b..0ff907b1bf2 100644--- a/webpack.config.ts+++ b/webpack.config.ts@@ -20,8 +20,9 @@ const cacheLoader: webpack.RuleSetUseItem = {},};-export default (env?: string): webpack.Configuration[] => {- const production: boolean = env === "production";+export default (_env: unknown, argv: {mode?: string}): webpack.Configuration[] => {+ const production: boolean = argv.mode === "production";+const config: webpack.Configuration = {name: "frontend",mode: production ? "production" : "development",