mirror of https://github.com/zulip/zulip.git
webpack: Use Webpack’s mode option rather than repurposing env.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
f628282c9e
commit
f644bf2063
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue