Package Exports
- babel-plugin-transform-minify-catch-param
Readme
babel-plugin-transform-minify-catch-param
Babel plugin that minifies unused catch clause parameter names in JavaScript/TypeScript to reduce bundle size.
What does it do?
Removes the parameter in catch
clauses if it is not used inside the block.
Example
Before:
try {
// ...
} catch (error) {} // error is not used
After:
try {
// ...
} catch {}
Install
npm i -D babel-plugin-transform-minify-catch-param
#or
yarn add -D babel-plugin-transform-minify-catch-param
How to configure
Add to your Babel config:
See the official Babel documentation for more details: https://babeljs.io/docs/en/configuration
{
"plugins": [
"babel-plugin-transform-minify-catch-param"
]
}