Use next generation JavaScript, today, with Babel
Issues with the output should be reported on the Babel issue tracker.
$ npm install --save-dev grunt-babel babel-preset-es2015
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
babel: {
options: {
sourceMap: true,
presets: ['es2015']
},
dist: {
files: {
'dist/app.js': 'src/app.js'
}
}
}
});
grunt.registerTask('default', ['babel']);See the Babel options, except for filename which is handled for you.
Type: Function
Callback to run after files are transpiled.
Examples:
grunt.initConfig({
babel: {
options: {
callback: function(grunt, files) {
console.log('Changed files:', files);
}
}
}
}
});MIT © Sindre Sorhus