Combining gulp-inject and gulp-coffee -


i compile coffee files , inject them index.html utilizing gulp streams.

this tried:

gulp.task('scripts', function() {   return gulp.src(paths.coffee.source)     .pipe(coffee())     .pipe(inject(paths.index.source))     .pipe(gulp.dest(paths.coffee.destination)); }); 

and error:

[17:57:39] 'scripts' errored after 2.19 ms passing target file string deprecated! pass vinyl file stream (i.e. use `gulp.src`)! 

apparently doing deprecated. possible in 1 stream?

you should provide inject vinyl file stream, error says, i.e. (as in documentation:https://github.com/klei/gulp-inject#injecting-files-relative-to-target-files):

var inject = require('gulp-inject');  gulp.src('./src/**/*.html')   .pipe(inject(gulp.src('./src/**/*.js', {read: false}), {relative: true}))   .pipe('./src'); 

or in code, should change

inject(paths.index.source)  

to

inject(gulp.src(paths.index.source, {read: false}), {relative: true})) 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -