babel-plugin-transform-minify-catch-param
v1.1.2
Published
Babel plugin that minifies catch parameter names to reduce bundle size
Downloads
12
Maintainers
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 usedAfter:
try {
// ...
} catch {}Install
npm i -D babel-plugin-transform-minify-catch-param
#or
yarn add -D babel-plugin-transform-minify-catch-paramHow 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"
]
}