Skip to content

Commit

Permalink
chore: remove invariant messages from bundle
Browse files Browse the repository at this point in the history
Add babel-plugin-dev-expression that conditionally renders
invariant messages based on the NODE_ENV state
This will reduce the bundle size as that code
will be removed during minification.
  • Loading branch information
grabkowski committed Jul 13, 2022
1 parent b0b8c53 commit 445c08c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = (api) => {
"./plugins/generate-proptypes/index.mjs",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-classes",
"babel-plugin-dev-expression",
].filter(Boolean),
};
};
7 changes: 7 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"axe-core": "^3.5.5",
"babel-eslint": "10.0.3",
"babel-jest": "^26.6.3",
"babel-plugin-dev-expression": "^0.2.3",
"browserslist": "^4.16.6",
"chalk": "^4.1.1",
"chromatic": "^6.0.5",
Expand Down

0 comments on commit 445c08c

Please sign in to comment.