标签:style blog io color ar sp java strong div
There are two ways to compiler the ES6 fils to Javascript file.
One:
traceur --out build/app.js --script js/app.js --experimental
Two:
Using grunt.
Install:
npm install -g traceur npm install grunt-contrib-watch npm install grunt-traceur-latest
GruntFile:
module.exports = function(grunt){ grunt.initConfig({ traceur: { options: { experimental:true }, custom: { files:{ ‘build/app.js‘: "js/**/*.js" } } }, watch: { files:"js/**/*.js", tasks: "traceur" } }); grunt.loadNpmTasks(‘grunt-traceur-latest‘); grunt.loadNpmTasks(‘grunt-contrib-watch‘); }
[ES6] 02. Traceur compiler and Grunt
标签:style blog io color ar sp java strong div
原文地址:http://www.cnblogs.com/Answer1215/p/4104620.html