https://github.com/cyansalt/babel-preset-omit-plugins
Omit certain plugins from a Babel preset
https://github.com/cyansalt/babel-preset-omit-plugins
Last synced: 6 months ago
JSON representation
Omit certain plugins from a Babel preset
- Host: GitHub
- URL: https://github.com/cyansalt/babel-preset-omit-plugins
- Owner: CyanSalt
- License: isc
- Created: 2022-02-21T14:00:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T02:45:36.000Z (about 2 years ago)
- Last Synced: 2025-06-28T21:50:46.425Z (about 1 year ago)
- Language: JavaScript
- Size: 270 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-preset-omit-plugins
[](https://www.npmjs.com/package/babel-preset-omit-plugins)
Omit certain plugins from a Babel preset.
> [!WARNING]
> This package is not yet stable. Please take special care before using it in a production environment.
## Usage
```shell
npm install --save-dev babel-preset-omit-plugins
```
```js
// babel.config.js
module.exports = {
presets: [
['babel-preset-omit-plugins', {
preset: 'preset-module',
plugins: [
'plugin-module-1',
'plugin-module-2',
// ...
],
}],
],
}
```
For example, if you are using the [Vue CLI](https://cli.vuejs.org/) and want to disable the [Decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators), you can:
```js
// babel.config.js
module.exports = {
presets: [
['babel-preset-omit-plugins', {
preset: '@vue/cli-plugin-babel/preset',
plugins: [
'@babel/plugin-proposal-decorators',
],
}],
],
}
```
If you need to provide options for the passed presets, you can use the array syntax of Babel configuration:
```js
// babel.config.js
module.exports = {
presets: [
['babel-preset-omit-plugins', {
preset: [
'@vue/cli-plugin-babel/preset',
{
// For example only
targets: { esmodules: true },
},
],
plugins: [
'@babel/plugin-proposal-decorators',
],
}],
],
}
```