From 3c8a1646b2f01ef98b0381447f65b3026c7f88e6 Mon Sep 17 00:00:00 2001 From: hustcc Date: Wed, 27 Sep 2023 10:49:31 +0800 Subject: [PATCH] fix: bundle sideEffects config --- 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: [ {