Closed psalaets closed 9 years ago
Is there any way for gulp-dom-src to be writeable? I am generating html which I want to pipe into gulp-dom-src to scan for script tags.
Right now I am doing
gulp.task('processScripts', function(cb) { var generateHtml = gulp.src(pathToTemplates) .pipe(evalTemplates()) .pipe(gulp.dest(destDir)); generateHtml.on('end', function() { var processScripts = gulpDomSrc({ file: destDir + 'index.html', selector: 'script' attribute: 'src' }) .pipe(processJsFiles()) .pipe(gulp.dest(...); processScripts.on('end', cb); }); });
I use events to order things properly and write/read disk an extra time.
I wish I could do
gulp.task('processScripts', function() { return gulp.src(pathToTemplates) .pipe(evalTemplates()) .pipe(gulpDomSrc.writeable({ // <-- this would be new selector: 'script' attribute: 'src' }) .pipe(processJsFiles()) .pipe(gulp.dest(...); });
Would you be open to a PR that implemented something like the latter example?
Yea definitely. I'll happily look at any PR that implements something like this.
Thanks
Would be great if there was a quick example in readme on how to use this feature.
Is there any way for gulp-dom-src to be writeable? I am generating html which I want to pipe into gulp-dom-src to scan for script tags.
Right now I am doing
I use events to order things properly and write/read disk an extra time.
I wish I could do
Would you be open to a PR that implemented something like the latter example?