Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.

Commit dde81ca

Browse files
committed
fix(gulp): Old-street style pipe works well!
1 parent 9321c86 commit dde81ca

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

gulpfile.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ function js() {
4141
const babel = require("gulp-babel");
4242
const uglify = require("gulp-uglify");
4343

44-
return pipeline(
45-
gulp.src(JS_DIR, OPTS),
46-
webpack({
47-
mode,
48-
devtool: "source-map",
49-
output: {
50-
filename: "script.js"
51-
}
52-
}),
53-
prodOnly(sourcemaps.init({loadMaps: true})),
54-
prodOnly(through.obj(function (file, enc, cb) {
44+
return gulp.src(JS_DIR, OPTS)
45+
.pipe(
46+
webpack({
47+
mode,
48+
devtool: "source-map",
49+
output: {
50+
filename: "script.js",
51+
},
52+
})
53+
)
54+
.pipe(prodOnly(sourcemaps.init({loadMaps: true}))
55+
.pipe(prodOnly(through.obj(function (file, enc, cb) {
5556
// Filter out the sourcemaps since gulp-sourcemaps handles them
5657
if (!file.path.endsWith(".map")) this.push(file);
5758
cb();
58-
})),
59-
prodOnly(babel({
59+
}))))
60+
.pipe( prodOnly(babel({
6061
presets: ["@babel/env"]
61-
})),
62-
prodOnly(uglify()),
63-
prodOnly(sourcemaps.write(".")),
64-
gulp.dest(DEST)
65-
);
62+
})))
63+
.pipe(prodOnly(uglify()))
64+
.pipe(prodOnly(sourcemaps.write(".")))
65+
.pipe(gulp.dest(DEST));
6666
}
6767

6868
function css() {

0 commit comments

Comments
 (0)