1.0.1 • Published 4 years ago

eleventy-plugin-babel v1.0.1

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

eleventy-plugin-babel

Created by Simeon Smith.

A plugin for 11ty to compile JS with gulp-babel.

Installation

Available on npm.

npm i -D eleventy-plugin-sass

Using Plugin

Open up your Eleventy config file (probably eleventy.js) and use addPlugin:

const pluginBabel = require('eleventy-plugin-js');

module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(pluginBabel, babelPluginOptions);
};

Read more about Eleventy plugins.

Options

KeyTypeDefaultDescription
Watchglob or array of globs['**/*.js', '!node_modules/**']The JS files or matches of the files you wish to compile (and watch when you serve).
UglifybooleanfalseIf you wish your JS code to be uglified using babel-uglify
outputDirString"dist/js"The directory where the compiled JS will output.
sourceMapsBooleanfalseIf you'd liked to output sourcemaps using gulp-sourcemaps
babelgulp-babel options{ presets: ['@babel/env'] }Options that are passed to gulp-babel. See gulp-babel for options.

Contributing

Feel free to create issues with suggestions, bugs or open pull requests with changes.

License

MIT © Simeon Smith.