exhibit-builder-babel

Exhibit builder for transforming JavaScript files using Babel

Usage no npm install needed!

<script type="module">
  import exhibitBuilderBabel from 'https://cdn.skypack.dev/exhibit-builder-babel';
</script>

README

babel

Exhibit.js builder plugin

Transforms JavaScript files using Babel.

$ npm install -D exhibit-builder-babel

NPM version Build Status Dependency Status devDependency Status peerDependency Status

Usage

  .use('babel', {stage: 1})

Compiles ES2015+ JavaScript to ES5.

Options

Most of the usual Babel options work as normal, except that I/O-related options won't have any effect. Also, sourceMaps defaults to true in this plugin; otherwise defaults are unchanged.

Additional options

include (string/array/function) — default: '**/*.{js,jsx,babel.js}'

Chooses which files should be compiled. Follows Exhibit’s glob convention.

replaceExt (regular expression) — default: /\.(jsx|babel\.js)$/

A regular expression to select the extension from the incoming filename. This extension will be replaced with .js when outputting compiled files, using file.replace(regex, '.js').


License

MIT