Skip to content

Commit e808919

Browse files
committed
fix gulp scripts pipeline failing on second run because of how sourcemaps are cleared
1 parent c58ef1f commit e808919

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gulpfile.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const argv = require('yargs')
1818

1919
const paths = {
2020
manifest: './public/assets',
21-
assets: './public/assets/{css,scripts}/*.{css,css.map,js,js.map}',
21+
assets: './public/assets/{css,scripts}/*.{css,js,map}',
2222
styles: {
2323
src: './resources/assets/styles/main.css',
2424
dest: './public/assets/css',
@@ -30,11 +30,6 @@ const paths = {
3030
},
3131
};
3232

33-
const clearSourcemaps = through.obj(function (file, enc, cb) {
34-
if (!/\.map$/.test(file.path)) this.push(file);
35-
cb();
36-
});
37-
3833
/**
3934
* Build un-compiled CSS into a minified version.
4035
*/
@@ -63,7 +58,10 @@ function styles() {
6358
function scripts() {
6459
return webpackStream(webpackConfig)
6560
.pipe(sourcemaps.init({loadMaps: true}))
66-
.pipe(clearSourcemaps)
61+
.pipe(through.obj(function (file, enc, cb) { // Remove Souremaps
62+
if (!/\.map$/.test(file.path)) this.push(file);
63+
cb();
64+
}))
6765
.pipe(babel())
6866
.pipe(gulpif(argv.production, uglify()))
6967
.pipe(concat('bundle.js'))

0 commit comments

Comments
 (0)