File tree Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -581,22 +581,33 @@ module.exports = function (grunt) {
581581 ext : '.js'
582582 } ]
583583 }
584- } ,< % } if ( filters . babel ) { % >
584+ } ,< % } % >
585585
586586 // Compiles ES6 to JavaScript using Babel
587587 babel: {
588588 options : {
589589 sourceMap : true
590- } ,
590+ } , < % if ( filters . babel ) { % >
591591 client : {
592592 files : [ {
593593 expand : true ,
594594 cwd : '<%%= yeoman.client %>' ,
595595 src : [ '{app,components}/**/!(*.spec).js' ] ,
596596 dest : '.tmp'
597597 } ]
598+ } , < % } %>
599+ server : {
600+ options : {
601+ optional : [ 'runtime' ]
602+ } ,
603+ files : [ {
604+ expand : true ,
605+ cwd : '<%%= yeoman.server %>' ,
606+ src : [ '**/*.{js,json}' ] ,
607+ dest : '<%%= yeoman.dist %>/<%%= yeoman.server %>'
608+ } ]
598609 }
599- } ,< % } if ( filters . stylus ) { % >
610+ } , < % if ( filters . stylus ) { % >
600611
601612 // Compiles Stylus to CSS
602613 stylus: {
@@ -902,6 +913,7 @@ module.exports = function (grunt) {
902913 'concat',
903914 'ngAnnotate',
904915 'copy:dist',
916+ 'babel:server',
905917 'cdnify',
906918 'cssmin',
907919 'uglify',
Original file line number Diff line number Diff line change 1414 "composable-middleware" : " ^0.3.0" ,
1515 "lodash" : " ^3.10.1" ,
1616 "lusca" : " ^1.3.0" ,
17- "babel-core " : " ^5.6.4 " ,<% if (filters.jade) { %>
17+ "babel-runtime " : " ^5.8.20 " ,<% if (filters.jade) { %>
1818 "jade" : " ^1.11.0" ,<% } %><% if (filters.html) { %>
1919 "ejs" : " ^2.3.3" ,<% } %><% if (filters.mongoose) { %>
2020 "mongoose" : " ^4.1.2" ,
3737 },
3838 "devDependencies" : {
3939 "autoprefixer" : " ^6.0.0" ,
40+ "babel-core" : " ^5.6.4" ,
4041 "grunt" : " ~0.4.5" ,
4142 "grunt-wiredep" : " ^2.0.0" ,
4243 "grunt-concurrent" : " ^2.0.1" ,
Original file line number Diff line number Diff line change 44
55'use strict' ;
66
7- // Set default node environment to development
8- process . env . NODE_ENV = process . env . NODE_ENV || 'development' ;
9-
107import express from 'express' ; < % if ( filters . mongoose ) { % >
118import mongoose from 'mongoose' ; < % } % > < % if ( filters . sequelize ) { % >
129import sqldb from './sqldb' ; < % } % >
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- // Register the Babel require hook
4- require ( 'babel-core/register' ) ;
3+ // Set default node environment to development
4+ var env = process . env . NODE_ENV = process . env . NODE_ENV || 'development' ;
5+
6+ if ( env === 'production' || env === 'test' ) {
7+ // Register the Babel require hook
8+ require ( 'babel-core/register' ) ;
9+ }
510
611// Export the application
712exports = module . exports = require ( './app' ) ;
You can’t perform that action at this time.
0 commit comments