From e808919c5c0fd26cc556a5aac69a62bf8c750a76 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Thu, 31 May 2018 18:26:34 +0200 Subject: [PATCH] fix gulp scripts pipeline failing on second run because of how sourcemaps are cleared --- gulpfile.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 581ebe423..61e13398c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,7 +18,7 @@ const argv = require('yargs') const paths = { manifest: './public/assets', - assets: './public/assets/{css,scripts}/*.{css,css.map,js,js.map}', + assets: './public/assets/{css,scripts}/*.{css,js,map}', styles: { src: './resources/assets/styles/main.css', dest: './public/assets/css', @@ -30,11 +30,6 @@ const paths = { }, }; -const clearSourcemaps = through.obj(function (file, enc, cb) { - if (!/\.map$/.test(file.path)) this.push(file); - cb(); -}); - /** * Build un-compiled CSS into a minified version. */ @@ -63,7 +58,10 @@ function styles() { function scripts() { return webpackStream(webpackConfig) .pipe(sourcemaps.init({loadMaps: true})) - .pipe(clearSourcemaps) + .pipe(through.obj(function (file, enc, cb) { // Remove Souremaps + if (!/\.map$/.test(file.path)) this.push(file); + cb(); + })) .pipe(babel()) .pipe(gulpif(argv.production, uglify())) .pipe(concat('bundle.js'))