-
Notifications
You must be signed in to change notification settings - Fork 524
Improve tree shakability #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
72bcb6c
5b7948c
27e04ed
2425402
44d0fbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,8 +71,8 @@ | |
| "clean": "rm -rf libcsm/ libesm/ dist/ coverage/ .nyc_output/", | ||
| "lint": "yarn eslint", | ||
| "build": "yarn lint && yarn generate-esm && yarn generate-cjs && yarn check-types && yarn run-rollup && yarn run-uglify", | ||
| "generate-cjs": "yarn tsc --module commonjs --outDir libcjs && echo '{\"type\": \"commonjs\"}' > libcjs/package.json", | ||
| "generate-esm": "yarn tsc --module nodenext --outDir libesm && echo '{\"type\": \"module\"}' > libesm/package.json", | ||
| "generate-cjs": "yarn tsc --module commonjs --outDir libcjs && echo {\"type\": \"commonjs\"} > libcjs/package.json", | ||
| "generate-esm": "yarn tsc --module nodenext --outDir libesm && echo {\"type\": \"module\",\"sideEffects\":false} > libesm/package.json", | ||
|
||
| "check-types": "yarn run-tsd && yarn run-attw", | ||
| "test": "nyc yarn _test", | ||
| "_test": "yarn build && cross-env NODE_ENV=test yarn run-mocha", | ||
|
|
@@ -127,5 +127,6 @@ | |
| "lines": 100, | ||
| "functions": 100, | ||
| "statements": 100 | ||
| } | ||
| }, | ||
| "sideEffects": false | ||
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if it'll serve a purpose, but I figure we should add
"sideEffects": falsehere too? It's true and could plausibly be useful, since a quick google reveals that tree-shaking plugins for CommonJS do exist. (I have no idea whether they respect"sideEffects": false, but even if they don't today, they might do tomorrow.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't add it since Prettier only use ESM version 😄