您好我正在尝试从教程中的gulp文件中运行任务:
var gulp = require('gulp'),
concat = require('gulp-concat'),
cssmin = require('gulp-cssmin'),
uglify = require('gulp-uglify');
var paths = {
webroot: "./wwwroot/"
};
paths.bootstrapCss = "./bower_components/bootstrap/dist/css/bootstrap.css";
paths.sbAdminCss = "./bower_components/startbootstrap-sb-admin-2/dist/css/sb-admin-2.css";
paths.fontAwesomeCss = "./bower_components/font-awesome/css/font-awesome.css";
paths.morrisCss = "./bower_components/morrisjs/morris.css";
paths.jqueryJs = "./bower_components/jquery/dist/jquery.js";
paths.raphaelJs = "./bower_components/raphael/raphael.js";
paths.morrisJs = "./bower_components/morrisjs/morris.js";
paths.fonts = "./bower_components/font-awesome/fonts/*";
paths.jsDest = paths.webroot + "js";
paths.cssDest = paths.webroot + "css";
paths.fontDest = paths.webroot + "font";
gulp.task("min:js", function () {
return gulp.src([paths.jqueryJs, paths.raphaelJs, paths.morrisJs])
.pipe(concat(paths.jsDest + "/min/site.min.js"))
.pipe(uglify())
.pipe(gulp.dest("."));
});
gulp.task("copy.css", function () {
return gulp.src([paths.bootstrapCss, paths.sbAdminCss, paths.fontAwesomeCss])
.pipe(gulp.dest(paths.cssDest));
});
gulp.task("copy:js", function () {
return gulp.src([paths.jqueryJs, paths.raphaelJs, paths.morrisJs])
.pipe(gulp.dest(paths.jsDest));
});
gulp.task("copy:css", function () {
return gulp.src([paths.bootstrapCss, paths.sbAdminCss, paths.fontAwesomeCss])
.pipe(gulp.dest(paths.cssDest));
});
gulp.task("copy:fonts", function () {
return gulp.src([paths.fonts])
.pipe(gulp.dest(paths.fontDest));
});
gulp.task("min:css", function () {
return gulp.src([paths.bootstrapCss, paths.sbAdminCss, paths.fontAwesomeCss])
.pipe(concat(paths.cssDest + "/min/site.min.css"))
.pipe(cssmin())
.pipe(gulp.dest("."));
});
gulp.task("min", ["min:js", "min:css:"]);
gulp.task("copy", ["copy:js", "copy:css", "copy:fonts"]);
复制任务有效但min返回“以代码1终止的进程”。我不确定我写错了什么。双重检查一切,但无济于事
答案 0 :(得分:0)
“min”gulp任务具有无效的依赖性
“min:css:”应为“min:css”。请注意尾随“:”