Commit 02a7bf1cf3d for woocommerce
commit 02a7bf1cf3dd9bfd3d48299478d2150e6f251dcd
Author: Daniel Mallory <daniel.mallory@automattic.com>
Date: Thu Apr 9 22:16:50 2026 +0100
Reduce Terser compression passes in WooCommerce Blocks (#64081)
* perf(blocks): reduce terser compression passes
* build(blocks): use one terser pass in development
* chore(blocks): update terser changelog entry
diff --git a/plugins/woocommerce/changelog/build-blocks-terser-single-pass b/plugins/woocommerce/changelog/build-blocks-terser-single-pass
new file mode 100644
index 00000000000..25d89f3792e
--- /dev/null
+++ b/plugins/woocommerce/changelog/build-blocks-terser-single-pass
@@ -0,0 +1,4 @@
+Significance: minor
+Type: dev
+
+Reduce WooCommerce Blocks non-production build time by using a single Terser compression pass outside production.
diff --git a/plugins/woocommerce/client/blocks/bin/webpack-shared-config.js b/plugins/woocommerce/client/blocks/bin/webpack-shared-config.js
index 8e352fca738..660bd015033 100644
--- a/plugins/woocommerce/client/blocks/bin/webpack-shared-config.js
+++ b/plugins/woocommerce/client/blocks/bin/webpack-shared-config.js
@@ -16,7 +16,7 @@ const sharedOptimizationConfig = {
comments: /translators:/i,
},
compress: {
- passes: 2,
+ passes: isProduction ? 2 : 1,
},
mangle: {
reserved: [ '__', '_n', '_nx', '_x' ],