Всем привет!
У меня постоянно падает gulp.js после нескольких минут работ.. Думал что это из-за livereload который был у меня установлен отдельно от gulp , и при его работе когда я делал конкатенацию с минификацией в gulp , последний зависал надолго.. Удалил livereload и начал юзать его в 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'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
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('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('main.js'))
.pipe(gulp.dest('app/js'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('app/js'));
});
gulp.task('default', ['connect', 'css', 'html', 'watch', 'scripts']);
PS D:\Dropbox\Работа\2014\Текущие\workspace\site_1_0_0> gulp
[11:28:54] Using gulpfile D:\Dropbox\Работа\2014\Текущие\workspace\site_1_0_0\gulpfile.js
[11:28:54] Starting 'connect'...
[11:28:54] Server started http://localhost:8080
[11:28:54] LiveReload started on port 35729
[11:28:54] Finished 'connect' after 352 ms
[11:28:54] Starting 'css'...
[11:28:54] Finished 'css' after 17 ms
[11:28:54] Starting 'html'...
[11:28:54] Finished 'html' after 11 ms
[11:28:54] Starting 'watch'...
[11:28:54] Finished 'watch' after 28 ms
[11:28:54] Starting 'scripts'...
[11:29:00] Finished 'scripts' after 5.56 s
[11:29:00] Starting 'default'...
[11:29:00] Finished 'default' after 12 ?s
[11:29:09] Starting 'html'...
[11:29:09] Finished 'html' after 6.04 ms
[11:29:57] Starting 'html'...
[11:29:57] Finished 'html' after 5.28 ms
[11:30:08] Starting 'html'...
[11:30:08] Finished 'html' after 3.11 ms
[11:30:50] Starting 'html'...
[11:30:50] Finished 'html' after 3.75 ms
[11:31:19] Starting 'html'...
[11:31:19] Finished 'html' after 1.87 ms
[11:31:28] Starting 'html'...
[11:31:28] Finished 'html' after 1.93 ms
[11:33:18] Starting 'html'...
[11:33:18] Finished 'html' after 2.12 ms
events.js:72
throw er; // Unhandled 'error' event
^
Error: EBUSY, open 'D:\Dropbox\╨а╨░╨▒╨╛╤В╨░\2014\╨в╨╡╨║╤Г╤Й╨╕╨╡\workspace\site_1_0_0\index.html'