我正在将Gulp从3版升级到4版。我在这件事上犯了一个错误
task did not complete
.在gulp版本4的编译任务中,有什么需要更改的吗?我认为添加一个
async
到异步吞咽。系列“清洁”任务。
安慰
[09:33:16] Using gulpfile C:\WebProjects\ITF\ITF.Web\Gulpfile.js
[09:33:16] Starting 'prod'...
[09:33:16] Starting 'compile'...
[09:33:16] The following tasks did not complete: prod, compile
[09:33:16] Did you forget to signal async completion?
Process terminated with code 1.
吞咽
gulp.task("prod", gulp.series(
"compile",
"bundle",
"min",
));
gulp.task('clean', function () {
return gulp.src(paths.dist, { read: false }).pipe(rimraf({ force: true }));
});
gulp.task("compile", () => gulp.series("clean", function () {
return gulp.src("./App/**/*.ts")
.pipe(inlineNg2Template({
base: "/", // Angular2 application base folder
target: "es6", // Can swap to es5
indent: 2, // Indentation (spaces)
useRelativePaths: false, // Use components relative assset paths
removeLineBreaks: false, // Content will be included as one line
templateExtension: ".html", // Update according to your file extension
templateFunction: false // If using a function instead of a string for `templateUrl`, pass a reference to that function here
}))
.pipe(typescript(tsProject))
.pipe(ignore("References.js"))
.pipe(gulp.dest("dist/App"))
.on("finish", function () {
console.log("Results finish");
console.log(gulp.src);
})
.on('error', function (err) { console.log(err.message); });
}));