Gulp: Object #<Object> has no method 'if' -
i have cloned repo working gulpfile.js, , when running gulf on cloned repo, received error
object #<object> has no method 'if'
the offending task code: gulp.task('html', ['styles'], function () {
return gulp.src('app/*.html') .pipe($.useref.assets({searchpath: '{.tmp,app}'})) .pipe($.if('*.css', $.csso())) .pipe($.useref.restore()) .pipe($.useref()) .pipe(gulp.dest('dist')); });
i have installed gulp-if , gulp-csso. $
var $ = require('gulp-load-plugins')();
still learning gulp. not sure go here.
in package.json, gulp-if not listed under devdependencies.
"devdependencies": { . . . "gulp-if": "^1.2.5",
including eliminated error.
whenever installing development dependency, should affix --save-dev bundle automatically placed in package.json, , cloning automatically packages in package.json issuing npm install command.
npm install <package> --save-dev
gulp gulp-if
No comments:
Post a Comment