Détail du package

@webpack-blocks/babel

andywer6.8kMIT2.1.0

Webpack block for babel 6+.

webpack, webpack-blocks

readme

webpack-blocks - Babel 6+

Gitter chat NPM Version

This is the babel block providing Babel (Version 7+) configuration using the babel-loader.

Installation

npm install --save-dev babel-core @webpack-blocks/babel
# or
yarn add --dev babel-core @webpack-blocks/babel

Usage

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/.

Options

cacheDirectory (optional)

Uses a cache directory if set to true. Defaults to true.

plugins (optional)

Array of Babel plugins to use. Babel will read them from .babelrc or package.json if omitted.

presets (optional)

Array of Babel presets to use. Babel will read them from .babelrc or package.json if omitted.

webpack-blocks

Check out the

👉 Main documentation

Released under the terms of the MIT license.

changelog

@webpack-blocks/babel - Changelog

2.0.0-alpha

  • Support for webpack 4 (#261)
  • Support for babel 7 (#295)

1.0.0-rc

  • Breaking change: Renamed package from babel6 to babel and moved babel-core to be a peer dependency (#217)

1.0.0-beta.2

  • Update dependency versions

1.0.0-beta

  • Use match() instead of passing an exclude option
  • Updated babel-loader from 6.x to 7.0, but sticking to babel 6.x

1.0.0-alpha

  • Updated for new core API (#125)
  • Requires node 6+

0.4.1

  • Fix default node_modules/ exclusion, so it works on windows (#108)

0.4.0

  • No changes, just keeping the version numbers in sync

0.3.0

  • Use context
  • Allow passing presets/plugins to block
  • May set include (white-list file matching), not just exclude

0.1.1

  • loaders: [ 'babel' ] => loaders: [ 'babel-loader' ]

0.1.0

Initial release.