diff --git a/tools/webpack b/tools/webpack index 18891489ca..7a4c9618b4 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.ts index 269af93957..0ff907b1bf 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",