Skip to content

Commit 7296d35

Browse files
troterscniro
authored andcommitted
Avoid sharing _options across multiple streams (#69)
Before this commit, variable _options is sharing multiple streams. It causes problems. _options.rebaseTo that was always set first is used. If we have below files and gulpfile.js, rebaseTo was always `<PROJECT_ROOT>/scss/entries/lp/lp1/css`, and never `<PROJECT_ROOT/scss/entries/lp/lp2/subpage/css>` ``` scss/entries/lp/lp1/css/index.scss scss/entries/lp/lp2/subpage/css/index.scss gulp .src('scss/entries/**/*.scss') .pipe(plumber()) .pipe(sass()) .pipe(cleanCSS()) // rebaseTo always 'scss/entries/apps/app1/css/', .pipe(gulp.dest('public/')); ```
1 parent 0cffc4d commit 7296d35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ const through = require('through2');
66

77
module.exports = (options, callback) => {
88

9-
let _options = Object.assign({}, options || {});
109
let _callback = callback || (o => undefined);
1110

1211
return through.obj(function (file, enc, cb) {
1312

13+
let _options = Object.assign({}, options || {});
14+
1415
if (file.isNull()) {
1516
return cb(null, file);
1617
}

0 commit comments

Comments
 (0)