babel-preset-extplug

4.0.2 • Public • Published

babel-preset-extplug

Babel preset for ExtPlug and plugins.

This includes ES2015 and some proposal plugins, targeting AMD or CommonJS modules.

Install

$ npm install --save-dev babel-preset-extplug

Usage

In your .babelrc:

{
  "presets": [
    ["extplug", { "amd": true|false }]
  ]
}

Because the preset can target AMD modules for plugins, it doesn't play nice with a gulpfile.babel.js. This means that you can't put it in your .babelrc if you also want to use ES-future in your gulpfile. Instead, put a config that works for gulp in your .babelrc, and pass babel-preset-extplug to Babel manually when you compile your plugin.

// .babelrc
{
  "presets": [
    ["extplug", { "amd": false }]
  ]
}
// gulpfile.babel.js
gulp.src(myPluginSources)
  .pipe(babel({
    babelrc: false,
    presets: [
      ['extplug', { amd: true }]
    ]
  }))
  .pipe(gulp.dest(builtPluginDirectory))

License

MIT

Package Sidebar

Install

npm i babel-preset-extplug

Weekly Downloads

11

Version

4.0.2

License

MIT

Last publish

Collaborators

  • goto-bus-stop