fix gulp scripts pipeline failing on second run because of how sourcemaps are cleared
This commit is contained in:
parent
c58ef1f8a8
commit
e808919c5c
1 changed files with 5 additions and 7 deletions
12
gulpfile.js
12
gulpfile.js
|
@ -18,7 +18,7 @@ const argv = require('yargs')
|
||||||
|
|
||||||
const paths = {
|
const paths = {
|
||||||
manifest: './public/assets',
|
manifest: './public/assets',
|
||||||
assets: './public/assets/{css,scripts}/*.{css,css.map,js,js.map}',
|
assets: './public/assets/{css,scripts}/*.{css,js,map}',
|
||||||
styles: {
|
styles: {
|
||||||
src: './resources/assets/styles/main.css',
|
src: './resources/assets/styles/main.css',
|
||||||
dest: './public/assets/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.
|
* Build un-compiled CSS into a minified version.
|
||||||
*/
|
*/
|
||||||
|
@ -63,7 +58,10 @@ function styles() {
|
||||||
function scripts() {
|
function scripts() {
|
||||||
return webpackStream(webpackConfig)
|
return webpackStream(webpackConfig)
|
||||||
.pipe(sourcemaps.init({loadMaps: true}))
|
.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(babel())
|
||||||
.pipe(gulpif(argv.production, uglify()))
|
.pipe(gulpif(argv.production, uglify()))
|
||||||
.pipe(concat('bundle.js'))
|
.pipe(concat('bundle.js'))
|
||||||
|
|
Loading…
Reference in a new issue