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
Post a Comment