@@ -137,7 +137,15 @@ let styles = lazypipe()
137
137
. pipe ( plugins . autoprefixer , { browsers : [ 'last 1 version' ] } )
138
138
. pipe ( plugins . sourcemaps . write , '.' ) ; < % if ( filters . babel || filters . coffee ) { % >
139
139
140
- let transpile = lazypipe ( )
140
+ let transpileServer = lazypipe ( )
141
+ . pipe ( plugins . sourcemaps . init ) < % if ( filters . babel ) { % >
142
+ . pipe ( plugins . babel , {
143
+ optional : [ 'runtime' ]
144
+ } ) < % } else { % >
145
+ . pipe ( plugins . coffee , { bare : true } ) < % } % >
146
+ . pipe ( plugins . sourcemaps . write , '.' ) ;
147
+
148
+ let transpileClient = lazypipe ( )
141
149
. pipe ( plugins . sourcemaps . init ) < % if ( filters . babel ) { % >
142
150
. pipe ( plugins . babel , {
143
151
optional : [ 'es7.classProperties' ]
@@ -255,13 +263,13 @@ gulp.task('styles', () => {
255
263
256
264
gulp . task ( 'transpile:client' , ( ) => {
257
265
return gulp . src ( paths . client . scripts )
258
- . pipe ( transpile ( ) )
266
+ . pipe ( transpileClient ( ) )
259
267
. pipe ( gulp . dest ( '.tmp' ) ) ;
260
268
} ) ; < % } % >
261
269
262
270
gulp . task ( 'transpile:server' , ( ) => {
263
271
return gulp . src ( _ . union ( paths . server . scripts , paths . server . json ) )
264
- . pipe ( transpile ( ) )
272
+ . pipe ( transpileServer ( ) )
265
273
. pipe ( gulp . dest ( `${ paths . dist } /${ serverPath } ` ) ) ;
266
274
} ) ;
267
275
@@ -335,7 +343,7 @@ gulp.task('watch', () => {
335
343
336
344
plugins . watch ( paths . client . scripts ) //['inject:js']
337
345
. pipe ( plugins . plumber ( ) ) < % if ( filters . babel || filters . coffee ) { % >
338
- . pipe ( transpile ( ) )
346
+ . pipe ( transpileClient ( ) )
339
347
. pipe ( gulp . dest ( '.tmp' ) ) < % } % >
340
348
. pipe ( plugins . livereload ( ) ) ;
341
349
0 commit comments