Skip to content

mjoynes-wombat-web/eleventy-plugin-babel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-babel

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.

About

Plugin to use gulp-babel to transpile JS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published