This is the babel
block providing Babel (Version 7+) configuration using the
babel-loader.
npm install --save-dev babel-core @webpack-blocks/babel
# or
yarn add --dev babel-core @webpack-blocks/babel
const { createConfig, match } = require('@webpack-blocks/webpack')
const babel = require('@webpack-blocks/babel')
module.exports = createConfig([
match(['*.js', '!*node_modules*'], [
babel(/* options */)
])
])
You can also use the babel block without match()
. It will by default match *.js
and *.jsx
files while excluding everything in node_modules/
.
Uses a cache directory if set to true. Defaults to true.
Array of Babel plugins to use. Babel will read them from .babelrc
or package.json
if omitted.
Array of Babel presets to use. Babel will read them from .babelrc
or package.json
if omitted.
Check out the
Released under the terms of the MIT license.