@@ -127,6 +127,13 @@ module.exports = function (grunt) {
127127 '<%%= yeoman.client %>/{app,components}/**/*.spec.{coffee,litcoffee,coffee.md}'
128128 ] ,
129129 tasks : [ 'karma' ]
130+ } , < % } % > < % if ( filters . babel ) { % >
131+ babel : {
132+ files : [
133+ '<%%= yeoman.client %>/{app,components}/**/*.js' ,
134+ '!<%%= yeoman.client %>/{app,components}/**/*.spec.js'
135+ ] ,
136+ tasks : [ 'babel' ]
130137 } , < % } % >
131138 gruntfile: {
132139 files : [ 'Gruntfile.js' ]
@@ -135,7 +142,11 @@ module.exports = function (grunt) {
135142 files : [
136143 '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.css' ,
137144 '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.html' ,
145+ < % if ( filters . babel ) { % >
146+ '.tmp/{app,components}/**/*.js' ,
147+ < % } else { % >
138148 '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js' ,
149+ < % } % >
139150 '!{ . tmp , < % %= yeoman . client % > } { app , components } /**/*.spec.js',
140151 '!{ . tmp , < % %= yeoman . client % > } / { app , components } /**/*.mock.js',
141152 '< % %= yeoman . client % > /assets/images/{ , * / / * } *.{ png , jpg , jpeg , gif , webp , svg } '
@@ -442,14 +453,16 @@ module.exports = function (grunt) {
442453 // Run some tasks in parallel to speed up the build process
443454 concurrent: {
444455 server : [ < % if ( filters . coffee ) { % >
445- 'coffee' , < % } %> < % if ( filters . jade ) { % >
456+ 'coffee' , < % } %> < % if ( filters . babel ) { % >
457+ 'babel',< % } % > < % if ( filters . jade ) { % >
446458 'jade',< % } % > < % if ( filters . stylus ) { % >
447459 'stylus',< % } % > < % if ( filters . sass ) { % >
448460 'sass',< % } % > < % if ( filters . less ) { % >
449461 'less',< % } % >
450462 ],
451463 test: [< % if ( filters . coffee ) { % >
452- 'coffee',< % } % > < % if ( filters . jade ) { % >
464+ 'coffee',< % } % > < % if ( filters . babel ) { % >
465+ 'babel',< % } % > < % if ( filters . jade ) { % >
453466 'jade',< % } % > < % if ( filters . stylus ) { % >
454467 'stylus',< % } % > < % if ( filters . sass ) { % >
455468 'sass',< % } % > < % if ( filters . less ) { % >
@@ -465,7 +478,8 @@ module.exports = function (grunt) {
465478 }
466479 } ,
467480 dist: [< % if ( filters . coffee ) { % >
468- 'coffee',< % } % > < % if ( filters . jade ) { % >
481+ 'coffee',< % } % > < % if ( filters . babel ) { % >
482+ 'babel',< % } % > < % if ( filters . jade ) { % >
469483 'jade',< % } % > < % if ( filters . stylus ) { % >
470484 'stylus',< % } % > < % if ( filters . sass ) { % >
471485 'sass',< % } % > < % if ( filters . less ) { % >
@@ -551,6 +565,24 @@ module.exports = function (grunt) {
551565 ext : '.js'
552566 } ]
553567 }
568+ } ,< % } % > < % if ( filters . babel ) { % >
569+
570+ // Compiles ES6 to JavaScript using Babel
571+ babel: {
572+ options : {
573+ sourceMap : true
574+ } ,
575+ server : {
576+ files : [ {
577+ expand : true ,
578+ cwd : 'client' ,
579+ src : [
580+ '{app,components}/**/*.js' ,
581+ '!{app,components}/**/*.spec.js'
582+ ] ,
583+ dest : '.tmp'
584+ } ]
585+ }
554586 } ,< % } % > < % if ( filters . stylus ) { % >
555587
556588 // Compiles Stylus to CSS
@@ -620,10 +652,16 @@ module.exports = function (grunt) {
620652 } ,
621653 files : {
622654 '<%%= yeoman.client %>/index.html' : [
623- [ '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js' ,
624- '!{.tmp,<%%= yeoman.client %>}/app/app.js' ,
625- '!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.spec.js' ,
626- '!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js' ]
655+ [
656+ < % if ( filters . babel ) { % >
657+ '.tmp/{app,components}/**/*.js' ,
658+ < % } else { % >
659+ '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js' ,
660+ < % } % >
661+ '!{ . tmp , < % %= yeoman . client % > } /app/app.js',
662+ '!{ . tmp , < % %= yeoman . client % > } / { app , components } /**/*.spec.js',
663+ '!{ . tmp , < % %= yeoman . client % > } / { app , components } /**/*.mock.js'
664+ ]
627665 ]
628666 }
629667 } , < % if ( filters . stylus ) { % >
0 commit comments