Closed OllieJennings closed 10 years ago
@OllieJennings instead of this.sass()
, do you get the same error if you just call sass()
? If you could throw up the code you're using for both your issues, that'd make it easier to debug :)
@jackfranklin The code is as follows:
gulpLoadTasks = require("gulp-load-tasks");
gulpLoadTasks(this);
gulp.task('sass', function () {
gulp.src('./etc...')
.pipe(sass())
.pipe(gulp.dest('....'));
Which gives the error:
[gulp] Running 'sass'...
[gulp] Errored 'sass' in 5.68 ms sass is not defined
And if l do this.sass()
instead of sass()
then l get the following error:
[gulp] Running 'sass'...
[gulp] Errored 'sass' in 5.74 ms Object #<Gulp> has no method 'sass'
Hopes this helps :)
@OllieJennings cheers, I'll give it a try. Final Q: you definitely have gulp-sass in your dependencies?
@jackfranklin Yep, this is what my package.json file looks like:
"dependencies": {
"express": "3.4.7",
"jade": "*"
},
"devDependencies": {
"gulp": "~3.1.4",
"gulp-load-tasks": "0.0.4",
"gulp-sass": "~0.2.2",
"gulp-uglify": "~0.1.0",
"gulp-concat": "~2.1.2"
}
@OllieJennings basically I was wrong, extending this
doesn't work because of the context that the gulp tasks are executed in.
I suggest you upgrade to 0.1.0, which now works like this:
var tasks = gulpLoadTasks();
gulp.task('sass', function () {
gulp.src('./etc...')
.pipe(tasks.sass())
.pipe(gulp.dest('....'));
Any probs give me a shout.
When doing
if
gulp-sass
is in your devDependencies, then callingthis.sass()
will result in the error#Gulp object does not have sass
Also, when passing in the second argument, it cannot seem to find the package.json file as seen in the attached file.