Skip to content

Commit c2ae9e2

Browse files
authored
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.
1 parent 20b6f4c commit c2ae9e2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/shared/CheckStringCoercion.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function willCoercionThrow(value: mixed): boolean {
4343
}
4444
}
4545

46+
/** @noinline */
4647
function testStringCoercion(value: mixed) {
4748
// If you ended up here by following an exception call stack, here's what's
4849
// happened: you supplied an object or symbol value to React (as a prop, key,

scripts/rollup/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ function getPlugins(
361361
const isProduction = isProductionBundleType(bundleType);
362362
const isProfiling = isProfilingBundleType(bundleType);
363363

364-
const needsMinifiedByClosure = isProduction && bundleType !== ESM_PROD;
364+
const needsMinifiedByClosure =
365+
bundleType !== ESM_PROD && bundleType !== ESM_DEV;
365366

366367
return [
367368
// Keep dynamic imports as externals

0 commit comments

Comments
 (0)