webpack: Use Webpack’s mode option rather than repurposing env.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-09-25 21:32:14 -07:00
committed by Tim Abbott
parent f628282c9e
commit f644bf2063
2 changed files with 4 additions and 5 deletions

View File

@@ -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",