Skip to content

Commit

Permalink
Declare no side effects in the modules (#98)
Browse files Browse the repository at this point in the history
After recent modification ES modules are correctly loaded but
tree-shaking in Webpack also requires declaring the packages to be side
effects-free. This is done by declaring `sideEffects: false` in the
package manifests.
  • Loading branch information
Igorbek committed Oct 19, 2023
1 parent cf5b9a3 commit 66a4b5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/itchy-monkeys-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@grammarly/focal": minor
"@grammarly/focal-atom": minor
---

Mark packages as side-effect free for proper tree shaking by Webpack and other bundlers.
1 change: 1 addition & 0 deletions packages/focal-atom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dist/_cjs/src/",
"dist/_esm2015/src/"
],
"sideEffects": false,
"scripts": {
"docs": "rm -rf ./docs && typedoc --out docs --theme minimal --ignoreCompilerErrors --tsconfig tsconfig.json",
"clean": "rm -rf ./dist",
Expand Down
1 change: 1 addition & 0 deletions packages/focal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dist/_cjs/src/",
"dist/_esm2015/src/"
],
"sideEffects": false,
"scripts": {
"docs": "rm -rf ./docs && typedoc --out docs --theme minimal --ignoreCompilerErrors --tsconfig tsconfig.json",
"clean": "rm -rf ./dist",
Expand Down

0 comments on commit 66a4b5c

Please sign in to comment.