Skip to content

Commit

Permalink
Update rollup config to use moduleSideEffects (#26199)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
ymqy authored Feb 20, 2023
1 parent db5e625 commit bc38a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,8 @@ async function createBundle(bundle, bundleType) {
const rollupConfig = {
input: resolvedEntry,
treeshake: {
pureExternalModules,
moduleSideEffects: (id, external) =>
!(external && pureExternalModules.includes(id)),
},
external(id) {
const containsThisModule = pkg => id === pkg || id.startsWith(pkg + '/');
Expand Down

0 comments on commit bc38a3d

Please sign in to comment.