Answer the question
In order to leave comments, you need to log in
Why does Gulp keep throwing an error?
Can you please tell me why I am getting an error in Gulp?
gulpfile.js
var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
minifyCSS = require('gulp-minify-css'),
prefix = require('gulp-autoprefixer'),
livereload = require('gulp-livereload'),
connect = require('gulp-connect'),
minifyHTML = require('gulp-minify-html'),
rename = require('gulp-rename');
// connect server
gulp.task('connect', function() {
connect.server({
root: 'app',
livereload: true
});
});
// css
gulp.task('css', function () {
gulp.src('css/*.css')
.pipe(concatCss('bundle.css'))
.pipe(prefix('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(minifyCSS())
.pipe(rename('bundle.min.css'))
.pipe(gulp.dest('app/css'))
.pipe(connect.reload())
});
//html
gulp.task('html', function() {
gulp.src('*.html')
.pipe(minifyHTML())
.pipe(gulp.dest('app'))
.pipe(connect.reload())
});
//watch
gulp.task('watch' , function() {
gulp.watch('css/*.css', ['css'])
gulp.watch('*.html', ['html'])
})
gulp.task('default', ['connect', 'css', 'html', 'watch']);
Answer the question
In order to leave comments, you need to log in
Error: EBUSY, open 'D:\WebServers\EasyPHP-DevServer-14.1VC9\data\localweb\projects\site4\css\main.css'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question