Skip to content

Commit

Permalink
Improve treeshaking by setting package.json sideEffects (#1332)
Browse files Browse the repository at this point in the history
* fix: mark sideEffects free

* fix: update sideEffects delcaration in package.json to improve treeshaking

* fix: update sideEffects delcaration in package.json to improve treeshaking

* fix: BaseStyles doesnt use sideeffects

* chore: add changeset
  • Loading branch information
mattcosta7 committed Jul 19, 2021
1 parent b7a1964 commit ec11d7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/beige-years-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/components': patch
---

Side effects are properly declared in package.json
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"main": "lib/index.js",
"module": "lib-esm/index.js",
"typings": "lib/index.d.ts",
"sideEffects": [
"(lib|lib-esm)/behaviors/focusZone.js",
"(lib|lib-esm)/behaviors/focusTrap.js"
],
"scripts": {
"start": "cd docs && npm run develop",
"predist": "rm -rf dist & rm -rf lib & rm -rf lib-esm",
Expand Down

1 comment on commit ec11d7b

@vercel
Copy link

@vercel vercel bot commented on ec11d7b Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Warning: primer-components.now.sh was not aliased since new "now.sh" domains are deprecated. Please use "vercel.app" instead. Learn More →

Please sign in to comment.