@playlyfe/babel-loader
v1.0.4
Published
babel module loader for webpack
Downloads
16
Readme
babel-loader
This package allows transpiling JavaScript files using Babel and webpack.
Requirements
{
node: '>=8.0.0',
webpack: '>=4.0.0',
babel: '>=7.0.0'
}
Install
$ npm install --save-dev @playlyfe/babel-loader
$ yarn add --dev @playlyfe/babel-loader
Usage
webpack documentation: Loaders
Within your webpack configuration object, you'll need to add the babel-loader to the list of modules, like so:
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules/,
use: {
loader: '@playlyfe/babel-loader',
options: {
cacheDirectory: 'cache-dir-path'
}
}
}
]
}
Options
cacheDirectory
:false | string
(Defaultfalse
). When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run.