JSPM

babel-plugin-transform-minify-catch-param

1.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q78291F
  • License MIT

Babel plugin that minifies catch parameter names to reduce bundle size

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"
  ]
}

License

MIT