phase2 / p2-theme-core

Core configuration for Pattern Lab Starter/Particle v9
16 stars 22 forks source link

Option for suppressing the sourceMappingURL #21

Open mike-potter opened 8 years ago

mike-potter commented 8 years ago

When compiling the theme for Open Atrium, we do not add the *.js.map file to the distribution to reduce the complexity of patch submissions. However, even when sourceMapEmbed is false, it still appends the sourceMappingURL to the end of the *.min.js file:

//# sourceMappingURL=oa_basetheme.script.min.js.map

Because this *.js.map file is not included in the distro, people get errors when they try to inspect the javascript since the file cannot be found.

Would be nice to add a new option for config.xml that could prevent any embedding of source map info. So, in js.js, changing:

    .pipe(sourcemaps.write((config.js.sourceMapEmbed) ? null : './'))

to something like:

    .pipe(gulpif(config.js.sourceMap || config.js.sourceMapEmbed, sourcemaps.write((config.js.sourceMapEmbed) ? null : './')))