eleventy-plugin-babel
v1.0.1
Published
Plugin to use gulp-babel to transpile JS.
Downloads
9
Readme
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
| Key | Type | Default | Description |
| ---------- | ---------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Watch | glob or array of globs | ['**/*.js', '!node_modules/**']
| The JS files or matches of the files you wish to compile (and watch when you serve). |
| Uglify | boolean | false
| If you wish your JS code to be uglified using babel-uglify |
| outputDir | String | "dist/js"
| The directory where the compiled JS will output. |
| sourceMaps | Boolean | false
| If you'd liked to output sourcemaps using gulp-sourcemaps |
| babel | gulp-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.