babel-preset-omit-plugins

0.1.0 • Public • Published

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

npm install --save-dev babel-preset-omit-plugins
// 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 and want to disable the Decorators, you can:

// 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:

// 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',
      ],
    }],
  ],
}

Readme

Keywords

Package Sidebar

Install

npm i babel-preset-omit-plugins

Weekly Downloads

0

Version

0.1.0

License

ISC

Unpacked Size

4.52 kB

Total Files

7

Last publish

Collaborators

  • cyansalt