From dbbedfebdb4118c92ecac852e76402824f05d3e0 Mon Sep 17 00:00:00 2001 From: hustcc Date: Wed, 27 Sep 2023 11:22:26 +0800 Subject: [PATCH] fix: bundle sideEffects config (#5603) --- package.json | 1 + rollup.config.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/package.json b/package.json index 03f8e86174..9525c4157e 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "test": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/ --coverage -i --logHeapUsage", "test:unit": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/unit/ --coverage -i --logHeapUsage", "test:integration": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/integration/ --coverage -i --logHeapUsage", + "preview": "vite preview", "build:umd": "rimraf ./dist && rollup -c && npm run size", "build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib", "build:esm": "rimraf ./esm && tsc --module ESNext --outDir esm", diff --git a/rollup.config.js b/rollup.config.js index ed3e9a2de5..b798a62435 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -20,6 +20,8 @@ export default [ input, treeshake: { preset: 'smallest', + // Set `src/exports` as a sideEffects file. + moduleSideEffects: (id, external) => id.includes('src/exports.ts') ? true : false, }, output: [ {