Minify DEV bundles with closure (#29809)
The goal is to improve speed of the development by inlining and DCE unused branches. We have the ability to preserve some variable names and pretty print in the production version so might as well do the same with DEV.
Sebastian Markbåge committed
Jun 8, 2024 at 11:15 UTC
c2ae9e28bc02fdd29c46b247d908e6b467ef06af
2 files changed
+3
-1
packages/shared/CheckStringCoercion.js
+1
@@ -43,6 +43,7 @@ function willCoercionThrow(value: mixed): boolean {
43
}
44
}
45
46
+/** @noinline */
47
function testStringCoercion(value: mixed) {
48
// If you ended up here by following an exception call stack, here's what's
49
// happened: you supplied an object or symbol value to React (as a prop, key,
scripts/rollup/build.js
+2
-1
@@ -361,7 +361,8 @@ function getPlugins(
361
const isProduction = isProductionBundleType(bundleType);
362
const isProfiling = isProfilingBundleType(bundleType);
363
364
- const needsMinifiedByClosure = isProduction && bundleType !== ESM_PROD;
364
+ const needsMinifiedByClosure =
365
+ bundleType !== ESM_PROD && bundleType !== ESM_DEV;
366
367
return [
368
// Keep dynamic imports as externals