File tree 4 files changed +24
-9
lines changed
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) {
581
581
ext : '.js'
582
582
} ]
583
583
}
584
- } ,< % } if ( filters . babel ) { % >
584
+ } ,< % } % >
585
585
586
586
// Compiles ES6 to JavaScript using Babel
587
587
babel: {
588
588
options : {
589
589
sourceMap : true
590
- } ,
590
+ } , < % if ( filters . babel ) { % >
591
591
client : {
592
592
files : [ {
593
593
expand : true ,
594
594
cwd : '<%%= yeoman.client %>' ,
595
595
src : [ '{app,components}/**/!(*.spec).js' ] ,
596
596
dest : '.tmp'
597
597
} ]
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
+ } ]
598
609
}
599
- } ,< % } if ( filters . stylus ) { % >
610
+ } , < % if ( filters . stylus ) { % >
600
611
601
612
// Compiles Stylus to CSS
602
613
stylus: {
@@ -902,6 +913,7 @@ module.exports = function (grunt) {
902
913
'concat',
903
914
'ngAnnotate',
904
915
'copy:dist',
916
+ 'babel:server',
905
917
'cdnify',
906
918
'cssmin',
907
919
'uglify',
Original file line number Diff line number Diff line change 14
14
"composable-middleware" : " ^0.3.0" ,
15
15
"lodash" : " ^3.10.1" ,
16
16
"lusca" : " ^1.3.0" ,
17
- "babel-core " : " ^5.6.4 " ,<% if (filters.jade) { %>
17
+ "babel-runtime " : " ^5.8.20 " ,<% if (filters.jade) { %>
18
18
"jade" : " ^1.11.0" ,<% } %><% if (filters.html) { %>
19
19
"ejs" : " ^2.3.3" ,<% } %><% if (filters.mongoose) { %>
20
20
"mongoose" : " ^4.1.2" ,
37
37
},
38
38
"devDependencies" : {
39
39
"autoprefixer" : " ^6.0.0" ,
40
+ "babel-core" : " ^5.6.4" ,
40
41
"grunt" : " ~0.4.5" ,
41
42
"grunt-wiredep" : " ^2.0.0" ,
42
43
"grunt-concurrent" : " ^2.0.1" ,
Original file line number Diff line number Diff line change 4
4
5
5
'use strict' ;
6
6
7
- // Set default node environment to development
8
- process . env . NODE_ENV = process . env . NODE_ENV || 'development' ;
9
-
10
7
import express from 'express' ; < % if ( filters . mongoose ) { % >
11
8
import mongoose from 'mongoose' ; < % } % > < % if ( filters . sequelize ) { % >
12
9
import sqldb from './sqldb' ; < % } % >
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
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
+ }
5
10
6
11
// Export the application
7
12
exports = module . exports = require ( './app' ) ;
You can’t perform that action at this time.
0 commit comments