File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 11var fs = require ( 'fs' ) ;
22var path = require ( 'path' ) ;
33var through = require ( 'through2' ) ;
4+ var merge = require ( 'lodash.merge' ) ;
45var trackFilenames = require ( 'gulp-track-filenames' ) ;
56var transformTools = require ( 'browserify-transform-tools' ) ;
67var browserify = require ( 'browserify' ) ;
@@ -230,10 +231,11 @@ function compile(bannerWidth, transforms) {
230231 // transforms
231232 transforms
232233 . concat ( requireTransform ( false ) )
233- . filter ( function ( candidate ) {
234- return ( typeof candidate === 'function' ) ;
235- } ) . forEach ( function ( item ) {
236- bundler . transform ( item , { global : true } ) ;
234+ . forEach ( function ( item , i , list ) {
235+ if ( typeof item === 'function' ) {
236+ var opts = ( typeof list [ i + 1 ] === 'object' ) ? merge ( { global : true } , list [ i + 1 ] ) : { global : true } ;
237+ bundler . transform ( item , opts ) ;
238+ }
237239 } ) ;
238240
239241 // require statements
Original file line number Diff line number Diff line change @@ -152,9 +152,9 @@ gulp.task('javascript:build', function () {
152152function init ( ) {
153153 cliArgs = cliArgs || yargs . resolveArgv ( ) ;
154154 transforms = [
155- to5ify . configure ( { ignoreRegex : / (? ! ) / } ) , // convert any es6 to es5 (ignoreRegex is degenerate)
156- stringify ( { minify : true } ) , // allow import of html to a string
157- ! cliArgs . unminified && ngAnnotate // @ngInject for angular injection points
155+ to5ify . configure ( { ignoreRegex : / (? ! ) / } ) , // convert any es6 to es5 (ignoreRegex is degenerate)
156+ stringify ( { minify : true } ) , // allow import of html to a string
157+ ! cliArgs . unminified && ngAnnotate , { sourcemap : true } // @ngInject for angular injection points
158158 ] ;
159159 // TODO @bholloway fix sourcemaps in ngAnnotate so that it may be included even when not minifying
160160}
You can’t perform that action at this time.
0 commit comments