Skip to content

Commit

Permalink
fix: bundle sideEffects config
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Sep 27, 2023
1 parent ba0c945 commit 3c8a164
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down

0 comments on commit 3c8a164

Please sign in to comment.