Author In ES6, Transpile To ES5 As A Build-step: A Workflow For Grunt | JavaScript for Line of Business Applications | Scoop.it

Today I used a Grunt task called grunt-traceur by Aaron Frost to author code in ES6 (maximally minimal classes, modules, rest params, spread operators) and transpile back to ES5 as a build-step. It felt fantastic and the final product now runs in all modern browsers.

 

I also played with grunt-es6-module-transpiler which let me target CommonJS or AMD as readily usable compile-targets for my modules. Both projects enable us to use JavaScript.next features in our apps before support actually lands in browsers. Judging by the ES6 compatibility table by @kangax this may still take a while so transpilation is an interesting option worth considering.