Skip to content

Commit a1558fa

Browse files
committed
add sourcemaps to gulp pipelines
1 parent 11d96c4 commit a1558fa

File tree

5 files changed

+2592
-2441
lines changed

5 files changed

+2592
-2441
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ APP_CLEAR_TASKLOG=720
77
APP_DELETE_MINUTES=10
88
APP_ENVIRONMENT_ONLY=true
99
LOG_CHANNEL=daily
10+
APP_
1011

1112
DB_HOST=127.0.0.1
1213
DB_PORT=3306

gulpfile.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const uglify = require('gulp-uglify-es').default;
1010
const webpackStream = require('webpack-stream');
1111
const webpackConfig = require('./webpack.config.js');
1212
const sourcemaps = require('gulp-sourcemaps');
13+
const through = require('through2');
1314

1415
const argv = require('yargs')
1516
.default('production', false)
@@ -29,6 +30,11 @@ const paths = {
2930
},
3031
};
3132

33+
const clearSourcemaps = through.obj(function (file, enc, cb) {
34+
if (!/\.map$/.test(file.path)) this.push(file);
35+
cb();
36+
});
37+
3238
/**
3339
* Build un-compiled CSS into a minified version.
3440
*/
@@ -56,7 +62,8 @@ function styles() {
5662
*/
5763
function scripts() {
5864
return webpackStream(webpackConfig)
59-
.pipe(sourcemaps.init())
65+
.pipe(sourcemaps.init({loadMaps: true}))
66+
.pipe(clearSourcemaps)
6067
.pipe(babel())
6168
.pipe(gulpif(argv.production, uglify()))
6269
.pipe(concat('bundle.js'))

0 commit comments

Comments
 (0)