From 625999f337b30505051c9f2461594a289a2b841a Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Mon, 21 Mar 2016 16:25:08 -0600 Subject: [PATCH] Fix sourcemap generation for dev builds This commit makes gulp unconditionally create external-file sourcemaps for dev builds. Currently dev builds create both external and inline sourcemaps, which seems to confuse browsers and often prevents maps from loading. Additionally, this enables 'loadMaps' for the gulp sourcemap plugin to make sure that all sourcemaps from browserify are moved into the external file, fixing maps for dependencies. Change-Id: I9fcb945d639a60c19c94d688ff26126c8f49e256 --- gulp/tasks/browserify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulp/tasks/browserify.js b/gulp/tasks/browserify.js index 8b1f366c..f10b0104 100644 --- a/gulp/tasks/browserify.js +++ b/gulp/tasks/browserify.js @@ -47,14 +47,14 @@ function buildScript(file) { function rebundle() { var stream = bundler.bundle(); - var createSourcemap = global.isProd && config.browserify.sourcemap; + var createSourcemap = config.browserify.sourcemap; gutil.log('Rebundle...'); return stream.on('error', handleErrors) .pipe(source(file)) .pipe(gulpif(createSourcemap, buffer())) - .pipe(gulpif(createSourcemap, sourcemaps.init())) + .pipe(gulpif(createSourcemap, sourcemaps.init({ loadMaps: true }))) .pipe(gulpif(global.isProd, streamify(uglify({ compress: { drop_console: true } }))))