Answer the question
In order to leave comments, you need to log in
Why is task gulp not working?
The task itself:
var gulp = require('gulp'),
mainCSS = require('gulp-clean-css'),
sass = require('gulp-sass'),
browserSync = require('browser-sync').create();
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "app/"
});
gulp.watch("app/sass/*.sass", ['sass']);
gulp.watch("app/*.html").on('change', browserSync.reload);
});
gulp.task('sass', function() {
return gulp.src("app/sass/*.sass")
.pipe(sass())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.stream());
});
gulp.task('default', [serve]);
{
"name": "myproject",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.24.7",
"gulp": "^3.9.1",
"gulp-clean-css": "^3.10.0",
"gulp-sass": "^4.0.1"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question