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
This commit is contained in:
Tim Buckley 2016-03-21 16:25:08 -06:00
parent 58ab033bb7
commit 625999f337
1 changed files with 2 additions and 2 deletions

View File

@ -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 }
}))))