Skip to content

Commit 7b8b4c2

Browse files
committed
chore(@vue/shared): add "sideEffects": false
As far as I can tell, all the code in this package is side-effects-free. Without the `sideEffects` flag, bundlers rely on code analysis and the `/*#__PURE__*/` comments for tree-shaking. As bundlers' implementations vary, the analysic may or may not be exhaustive. For example, a file that contains only the following line of code: ```js import { capitalize } from '@vue/shared' ``` If bundled by esbuild (`esbuild --bundle test.js --tree-shaking=true`), the output would be tens of lines. After this PR, the output will be an empty IIFE. Credit to @hardfist for discovering this issue.
1 parent 5898629 commit 7b8b4c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/shared/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"index.js",
1010
"dist"
1111
],
12+
"sideEffects": false,
1213
"buildOptions": {
1314
"formats": [
1415
"esm-bundler",

0 commit comments

Comments
 (0)