@playlyfe/babel-loader

1.0.4 • Public • Published

npm npm Travis

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 (Default false). 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.

/@playlyfe/babel-loader/

    Package Sidebar

    Install

    npm i @playlyfe/babel-loader

    Weekly Downloads

    2

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    26 kB

    Total Files

    20

    Last publish

    Collaborators

    • kumarharsh
    • mayank1791989