Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/babel/grunt-babel
Grunt plugin for Babel
https://github.com/babel/grunt-babel
babel grunt-plugin
Last synced: 7 days ago
JSON representation
Grunt plugin for Babel
- Host: GitHub
- URL: https://github.com/babel/grunt-babel
- Owner: babel
- License: mit
- Created: 2014-10-06T10:37:53.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:01:19.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T15:14:08.640Z (about 1 month ago)
- Topics: babel, grunt-plugin
- Language: JavaScript
- Homepage: https://babeljs.io
- Size: 1000 KB
- Stars: 437
- Watchers: 19
- Forks: 70
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- es6-tools - grunt-babel - Turn ES6+ code into vanilla ES5 with no runtime (Build-time transpilation / Grunt Tasks)
README
> This readme is for grunt-babel v8 + Babel v7
> Check the [7.x branch](https://github.com/babel/grunt-babel/tree/7.x) for docs with Babel v6# grunt-babel [![Build Status](https://travis-ci.org/babel/grunt-babel.svg?branch=master)](https://travis-ci.org/babel/grunt-babel)
> Use next generation JavaScript, today, with [Babel](https://babeljs.io)
*Issues with the output should be reported on the Babel [issue tracker](https://github.com/babel/babel/issues).*
## Install
For Babel 7.x and grunt-babel v8
```sh
$ yarn add --dev grunt-babel @babel/core @babel/preset-env
```For Babel 6.x and grunt-babel v7
```sh
$ yarn add --dev grunt-babel@7 babel-core babel-preset-env
```
Note: See the [7.x branch](https://github.com/babel/grunt-babel/tree/7.x) for more examples of
usage of Babel 6.x. This README is primarily applicable for Babel 7.x## Usage
### Option with load-grunt-tasks
```js
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasksgrunt.initConfig({
babel: {
options: {
sourceMap: true,
presets: ['@babel/preset-env']
},
dist: {
files: {
'dist/app.js': 'src/app.js'
}
}
}
});grunt.registerTask('default', ['babel']);
```### Option with loadNpmTasks
```js
grunt.initConfig({
babel: {
options: {
sourceMap: true,
presets: ['@babel/preset-env']
},
dist: {
files: {
'dist/app.js': 'src/app.js'
}
}
}
});grunt.loadNpmTasks('grunt-babel');
grunt.registerTask('default', ['babel']);
```## Options
See the Babel [options](https://babeljs.io/docs/en/options), except for `filename` which is handled for you.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)