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.
This commit is contained in:
Sebastian Markbåge
2024-06-08 11:15:57 -04:00
committed by GitHub
parent 20b6f4c0e8
commit c2ae9e28bc
2 changed files with 3 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ function willCoercionThrow(value: mixed): boolean {
}
}
/** @noinline */
function testStringCoercion(value: mixed) {
// If you ended up here by following an exception call stack, here's what's
// happened: you supplied an object or symbol value to React (as a prop, key,

View File

@@ -361,7 +361,8 @@ function getPlugins(
const isProduction = isProductionBundleType(bundleType);
const isProfiling = isProfilingBundleType(bundleType);
const needsMinifiedByClosure = isProduction && bundleType !== ESM_PROD;
const needsMinifiedByClosure =
bundleType !== ESM_PROD && bundleType !== ESM_DEV;
return [
// Keep dynamic imports as externals