ENOSPC
在ubuntu系统
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
示例
var gulp = require('gulp')
var sass = require('gulp-sass')
var uglify = require('gulp-uglify')
var minifyCss = require('gulp-minify-css')
var htmlMin = require('gulp-htmlmin')
var pump = require('pump')
var del = require('del')
// 编译scss为css
gulp.task('sass', function () {
return gulp.src('./scss/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.des```t('./css'));
})
// 监测并自动编译scss
gulp.task('sass:watch', function () {
gulp.watch('./scss/**/*.scss', ['sass']);
})
// 打包前删除dist内文件
gulp.task('clean:dist', function () {
del.sync(['./dist/**/*'])
})
// 打包任务
gulp.task('build', ['clean:dist'], function () {
gulp.src('./css/**/*.css')
.pipe(minifyCss())
.pipe(gulp.dest('./dist/css'))
gulp.src('./font/**/*')
.pipe(gulp.dest('./dist/font'))
gulp.src('./images/**/*')
.pipe(gulp.dest('./dist/images'))
gulp.src('./favicon.ico')
.pipe(gulp.dest('./dist/'))
pump([
gulp.src('./js/**/*.js'),
uglify(),
gulp.dest('./dist/js')
])
gulp.src('./*.html')
.pipe(htmlMin({
removeComments: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
}))
.pipe(gulp.dest('./dist'))
})
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。