Turn ES6 code into vanilla ES5 with no runtime required using babel
Issues with the output should be reported on the babel issue tracker.
$ npm install --save-dev grunt-babel
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
babel: {
options: {
sourceMap: true
},
dist: {
files: {
'dist/app.js': 'src/app.js'
}
}
}
});
grunt.registerTask('default', ['babel']);
See the babel
options, except for filename
which is handled for you.
MIT © Sindre Sorhus