webpack: Disable CompressionPlugin for Puppeteer tests.

Zopfli is very slow and the development server does not use its output
anyway.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-11-06 15:51:03 -08:00
committed by Anders Kaseorg
parent 30c54d023b
commit cd701c8468
2 changed files with 4 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ import assets from "./webpack.assets.json";
import dev_assets from "./webpack.dev-assets.json";
const config = (
env: {minimize?: boolean; ZULIP_VERSION?: string} = {},
env: {minimize?: true; puppeteer_tests?: true; ZULIP_VERSION?: string} = {},
argv: {mode?: string},
): webpack.Configuration[] => {
const production: boolean = argv.mode === "production";
@@ -55,7 +55,7 @@ const config = (
publicPath: production ? "/static/webpack-bundles/" : "/webpack/",
}),
];
if (production) {
if (production && !env.puppeteer_tests) {
plugins.push(
new CompressionPlugin<ZopfliOptions>({
// Use zopfli to write pre-compressed versions of text files