wiledal / gulp-include

Enables functionality similar to that of snockets / sprockets or other file insertion compilation tools.
158 stars 68 forks source link

Independent require in several files #86

Closed PFight closed 5 years ago

PFight commented 6 years ago

When we pass several files, only first file is processed.

// only test1.js is processed, test2.js is ignored
gulp.src(["test1.js", "test2.js"]) 
 .pipe(gulpInclude())
 .pipe(gulp.dest("./out"));

Minimal reproducing example: https://github.com/PFight/gulp-include-bug

Note, if I replace //=require to //=include, then everything is works. So, gulp-include consider, that require in separate files as in one scope, and ignore second require.

My files test1.js and test2.js are totally independent. How can I force gulp-include to process them separately?

PFight commented 6 years ago

Until pull request merged, created new package with this issue solved https://www.npmjs.com/package/gulp-include-ext

KenEucker commented 5 years ago

I'm also experiencing this issue. If you have a gulp.src call with more than one file, only one of the resulting files will have include run on it. It would be nice to have a flag to ignore includes across separate globs.

KenEucker commented 5 years ago

@PFight this issue has been addressed and was included in #94, If you see this message please let me know.

I wonder if you would consider deprecating gulp-include-ext now that this feature has been merged in.

PFight commented 5 years ago

@KenEucker thanks, I have deprecated gulp-include-ext.

KenEucker commented 5 years ago

Awesome, thank you for your contributions!