0.1.2 • Published 4 years ago

babel-webpack-plugin v0.1.2

Weekly downloads
2,134
License
MIT
Repository
-
Last release
4 years ago

Babel is a compiler for writing next generation JavaScript.

A babel plugin (not a loader) for webpack.

Webpack 2 can handle native ES2015 modules, so there's no need to run babel's es2015 preset on every module before passing it to webpack. Doing so just adds to compile time. In addition, as loaders are updated to return ES2015, you would need to add a babel-loader to the top of the chain for every single filetype.

This plugin runs babel only once per asset, at the end of the compilation process.

Installation

npm install babel-webpack-plugin

Usage

Add BabelPlugin to the list of plugins.

var BabelPlugin = require("babel-webpack-plugin");

plugins: [
	new BabelPlugin({
		test: /\.js$/,
		presets: ['es2015'],
		sourceMaps: false,
		compact: false
	})
]

Options

The options above are the default, see all options for babel here.

0.1.2

4 years ago

0.1.1

7 years ago

0.1.0

7 years ago