Closed silu44 closed 5 years ago
I got this error : Cannot run sass task: missing in gulpfile.js
here is my gulpfile.js
var gulp = require('gulp'); var sass = require('gulp-sass'); var cleanCss = require('gulp-clean-css'); var rename = require('gulp-rename');
var paths = { sass: ['./scss/*/.scss'] };
gulp.task('default', ['sass']);
gulp.task('sass', function(done) { gulp.src('./scss/ionic.app.scss') .pipe(sass()) .on('error', sass.logError) .pipe(gulp.dest('./www/css/')) .pipe(cleanCss({ keepSpecialComments: 0 })) .pipe(rename({ extname: '.min.css' })) .pipe(gulp.dest('./www/css/')) .on('end', done); });
gulp.task('watch', ['sass'], function() { gulp.watch(paths.sass, ['sass']); })
Without seeing your package.json, my guess is you installed Gulp v4 but the gulpfile is written for Gulp v3. Either upgrade your gulpfile to the new syntax or roll back to Gulp v3.9.1.
I got this error : Cannot run sass task: missing in gulpfile.js
here is my gulpfile.js
var gulp = require('gulp'); var sass = require('gulp-sass'); var cleanCss = require('gulp-clean-css'); var rename = require('gulp-rename');
var paths = { sass: ['./scss/*/.scss'] };
gulp.task('default', ['sass']);
gulp.task('sass', function(done) { gulp.src('./scss/ionic.app.scss') .pipe(sass()) .on('error', sass.logError) .pipe(gulp.dest('./www/css/')) .pipe(cleanCss({ keepSpecialComments: 0 })) .pipe(rename({ extname: '.min.css' })) .pipe(gulp.dest('./www/css/')) .on('end', done); });
gulp.task('watch', ['sass'], function() { gulp.watch(paths.sass, ['sass']); })