Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mayank1791989/babel-loader
babel loader for webpack
https://github.com/mayank1791989/babel-loader
babel7 loader webpack webpack4
Last synced: about 15 hours ago
JSON representation
babel loader for webpack
- Host: GitHub
- URL: https://github.com/mayank1791989/babel-loader
- Owner: Mayank1791989
- Created: 2018-11-13T15:41:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T16:52:13.000Z (almost 2 years ago)
- Last Synced: 2024-12-08T23:16:19.264Z (25 days ago)
- Topics: babel7, loader, webpack, webpack4
- Language: JavaScript
- Homepage:
- Size: 2.47 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![npm](https://img.shields.io/npm/v/@playlyfe/babel-loader.svg?style=flat-square)](https://www.npmjs.com/package/@playlyfe/babel-loader)
[![npm](https://img.shields.io/npm/dt/@playlyfe/babel-loader.svg?style=flat-square)](https://www.npmjs.com/package/@playlyfe/babel-loader)
[![Travis](https://img.shields.io/travis/Mayank1791989/babel-loader.svg?style=flat-square)](https://travis-ci.org/Mayank1791989/babel-loader)# babel-loader
> This package allows transpiling JavaScript files using [Babel](https://github.com/babel/babel) and [webpack](https://github.com/webpack/webpack).
## Requirements
```javascript
{
node: '>=8.0.0',
webpack: '>=4.0.0',
babel: '>=7.0.0'
}
```## Install
```sh
$ npm install --save-dev @playlyfe/babel-loader
$ yarn add --dev @playlyfe/babel-loader
```## Usage
webpack documentation: [Loaders](https://webpack.js.org/loaders/)
Within your webpack configuration object, you'll need to add the babel-loader to the list of modules, like so:
```javascript
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.