@@ -128,6 +128,13 @@ module.exports = function (grunt) {
128128 '<%%= yeoman.client %>/{app,components}/**/*.spec.{coffee,litcoffee,coffee.md}'
129129 ] ,
130130 tasks : [ 'karma' ]
131+ } , < % } % > < % if ( filters . babel ) { % >
132+ babel : {
133+ files : [
134+ '<%%= yeoman.client %>/{app,components}/**/*.js' ,
135+ '!<%%= yeoman.client %>/{app,components}/**/*.spec.js'
136+ ] ,
137+ tasks : [ 'babel' ]
131138 } , < % } % >
132139 gruntfile: {
133140 files : [ 'Gruntfile.js' ]
@@ -136,7 +143,11 @@ module.exports = function (grunt) {
136143 files : [
137144 '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.css' ,
138145 '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.html' ,
146+ < % if ( filters . babel ) { % >
147+ '.tmp/{app,components}/**/*.js' ,
148+ < % } else { % >
139149 '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js' ,
150+ < % } % >
140151 '!{ . tmp , < % %= yeoman . client % > } { app , components } /**/*.spec.js',
141152 '!{ . tmp , < % %= yeoman . client % > } / { app , components } /**/*.mock.js',
142153 '< % %= yeoman . client % > /assets/images/{ , * / / * } *.{ png , jpg , jpeg , gif , webp , svg } '
@@ -457,18 +468,20 @@ module.exports = function (grunt) {
457468
458469 // Run some tasks in parallel to speed up the build process
459470 concurrent: {
460- server : [ < % if ( filters . coffee ) { % >
461- 'coffee' , < % } %> < % if ( filters . jade ) { % >
462- 'jade',< % } % > < % if ( filters . stylus ) { % >
463- 'stylus',< % } % > < % if ( filters . sass ) { % >
464- 'sass',< % } % > < % if ( filters . less ) { % >
471+ server : [ < % if ( filters . coffee ) { % >
472+ 'coffee' , < % } %> < % if ( filters . babel ) { % >
473+ 'babel',< % } % > < % if ( filters . jade ) { % >
474+ 'jade',< % } % > < % if ( filters . stylus ) { % >
475+ 'stylus',< % } % > < % if ( filters . sass ) { % >
476+ 'sass',< % } % > < % if ( filters . less ) { % >
465477 'less',< % } % >
466478 ],
467- test: [< % if ( filters . coffee ) { % >
468- 'coffee',< % } % > < % if ( filters . jade ) { % >
469- 'jade',< % } % > < % if ( filters . stylus ) { % >
470- 'stylus',< % } % > < % if ( filters . sass ) { % >
471- 'sass',< % } % > < % if ( filters . less ) { % >
479+ test: [< % if ( filters . coffee ) { % >
480+ 'coffee',< % } % > < % if ( filters . babel ) { % >
481+ 'babel',< % } % > < % if ( filters . jade ) { % >
482+ 'jade',< % } % > < % if ( filters . stylus ) { % >
483+ 'stylus',< % } % > < % if ( filters . sass ) { % >
484+ 'sass',< % } % > < % if ( filters . less ) { % >
472485 'less',< % } % >
473486 ],
474487 debug: {
@@ -480,11 +493,12 @@ module.exports = function (grunt) {
480493 logConcurrentOutput : true
481494 }
482495 } ,
483- dist: [< % if ( filters . coffee ) { % >
484- 'coffee',< % } % > < % if ( filters . jade ) { % >
485- 'jade',< % } % > < % if ( filters . stylus ) { % >
486- 'stylus',< % } % > < % if ( filters . sass ) { % >
487- 'sass',< % } % > < % if ( filters . less ) { % >
496+ dist: [< % if ( filters . coffee ) { % >
497+ 'coffee',< % } % > < % if ( filters . babel ) { % >
498+ 'babel',< % } % > < % if ( filters . jade ) { % >
499+ 'jade',< % } % > < % if ( filters . stylus ) { % >
500+ 'stylus',< % } % > < % if ( filters . sass ) { % >
501+ 'sass',< % } % > < % if ( filters . less ) { % >
488502 'less',< % } % >
489503 'imagemin',
490504 'svgmin'
@@ -618,7 +632,25 @@ module.exports = function (grunt) {
618632 ext : '.js'
619633 } ]
620634 }
621- } ,< % } % > < % if ( filters . stylus ) { % >
635+ } ,< % } % > < % if ( filters . babel ) { % >
636+
637+ // Compiles ES6 to JavaScript using Babel
638+ babel: {
639+ options : {
640+ sourceMap : true
641+ } ,
642+ server : {
643+ files : [ {
644+ expand : true ,
645+ cwd : 'client' ,
646+ src : [
647+ '{app,components}/**/*.js' ,
648+ '!{app,components}/**/*.spec.js'
649+ ] ,
650+ dest : '.tmp'
651+ } ]
652+ }
653+ } ,< % } % > < % if ( filters . stylus ) { % >
622654
623655 // Compiles Stylus to CSS
624656 stylus: {
@@ -687,10 +719,16 @@ module.exports = function (grunt) {
687719 } ,
688720 files : {
689721 '<%%= yeoman.client %>/index.html' : [
690- [ '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js' ,
691- '!{.tmp,<%%= yeoman.client %>}/app/app.js' ,
692- '!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.spec.js' ,
693- '!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js' ]
722+ [
723+ < % if ( filters . babel ) { % >
724+ '.tmp/{app,components}/**/*.js' ,
725+ < % } else { % >
726+ '{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js' ,
727+ < % } % >
728+ '!{ . tmp , < % %= yeoman . client % > } /app/app.js',
729+ '!{ . tmp , < % %= yeoman . client % > } / { app , components } /**/*.spec.js',
730+ '!{ . tmp , < % %= yeoman . client % > } / { app , components } /**/*.mock.js'
731+ ]
694732 ]
695733 }
696734 } , < % if ( filters . stylus ) { % >
0 commit comments