如果需要逐个观看文件,这是工作文件
sources.srchtmlfile = [ "dev/app/**/*.html", "!dev/app/home/home.html", !dev/app/logon/logon.html" ]
gulp.task("src.html", function() {
return gulp.src(sources.srchtmlfile)
.pipe(watch(sources.srchtmlfile)).pipe(plumber()).pipe(
gulpif(minify, minifyHTML(minifyHTMLopts))).pipe(
gulp.dest("build/view/")).pipe(filelog("HTML"));
});
但是我正在尝试观看许多文件并将其合并为一个不起作用的文件
sources.srcjsfiles = [ "dev/app/**/*.js","!dev/app/config/config.js" ]
gulp.task("src.script", function() {
return gulp.src(sources.srcjsfiles)
.pipe(watch(sources.srcjsfiles)).pipe(plumber()).pipe(
gulpif(minify, uglify())).pipe(concat("all.min.js")).pipe(
gulp.dest("build/js/")).pipe(filelog("JS"));
});
我的 package.json 是
{
"name": "app",
"version": "1.0.1",
"dependencies": {
"del": "^0.1.3",
"gulp": "^3.8.8",
"gulp-changed": "^1.0.0",
"gulp-concat": "^2.4.1",
"gulp-cssmin": "^0.1.6",
"gulp-filelog": "^0.2.0",
"gulp-if": "^1.2.5",
"gulp-minify-html": "^0.1.7",
"gulp-plumber": "^0.6.6",
"gulp-uglify": "^1.0.1",
"gulp-war": "0.0.1",
"gulp-watch": "^3.0.0",
"gulp-webserver": "^0.8.3",
"gulp-zip": "^2.0.2"
}
}