Update rollup config to use moduleSideEffects (#26199)
## Summary In rollup v1.19.4, The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead, see https://github.com/rollup/rollup/blob/v1.19.4/src/Graph.ts#L130. ## How did you test this change? ci green
Ming Ye committed
Feb 20, 2023 at 13:04 UTC
bc38a3dfa74f63e66a8307d34ad6d52e838ab3b0
1 file changed
+2
-1
scripts/rollup/build.js
+2
-1
@@ -564,7 +564,8 @@ async function createBundle(bundle, bundleType) {
564
const rollupConfig = {
565
input: resolvedEntry,
566
treeshake: {
567
- pureExternalModules,
567
+ moduleSideEffects: (id, external) =>
568
+ !(external && pureExternalModules.includes(id)),
569
},
570
external(id) {
571
const containsThisModule = pkg => id === pkg || id.startsWith(pkg + '/');