refactor[ci/build]: dont generate sourcemaps for BROWSER_SCRIPT bundles (#27665)
Instead of https://github.com/facebook/react/pull/27664, we can just exclude `unstable_server-external-runtime.js` from having sourcemaps for now. We should consider removing manual copying of this artifact in https://github.com/facebook/react/blob/52d542ad6d410008c495084f511247f43387055f/.github/workflows/commit_artifacts.yml#L136-L138 As described in https://github.com/facebook/react/pull/27664, this artifact doesn't have any effect on the `hash`, which is used for generating React version identifier.
Ruslan Lesiutin committed
Nov 9, 2023 at 16:11 UTC
78c71bc545bf5c0fdeedc023b69fafe05d988067
1 file changed
+4
scripts/rollup/build.js
+4
@@ -406,6 +406,10 @@ function getPlugins(
406
// UMD builds are rarely used and not worth having sourcemaps.
407
const needsSourcemaps =
408
needsMinifiedByClosure &&
409
+ // This will only exclude `unstable_server-external-runtime.js` artifact
410
+ // To start generating sourcemaps for it, we should stop manually copying it to `facebook-www`
411
+ // and force `react-dom` to include .map files in npm-package at the root level
412
+ bundleType !== BROWSER_SCRIPT &&
413
!isUMDBundle &&
414
!sourcemapPackageExcludes.includes(entry) &&
415
!shouldStayReadable;