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
This commit is contained in:
Ming Ye 2023-02-20 13:04:26 +08:00 committed by GitHub
parent db5e6250d4
commit bc38a3dfa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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 + '/');