Skip to content

Commit

Permalink
Minify DEV bundles with closure (#29809)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebmarkbage authored Jun 8, 2024
1 parent 20b6f4c commit c2ae9e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/shared/CheckStringCoercion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2ae9e2

Please sign in to comment.