gpt4 book ai didi

gulp - 为什么我的任务运行程序资源管理器中未创建子任务?

转载 作者:行者123 更新时间:2023-12-03 03:40:06 25 4
gpt4 key购买 nike

我正在编写 Gulp 教程(使用此网站: http://www.davepaquette.com/archive/2014/10/08/how-to-use-gulp-in-visual-studio.aspx )。

这是 gulpFile.js:

    // include plug-ins
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var del = require('del');

var config = {
//Include all js files but exclude any min.js files
src: ['app/**/*.js', '!app/**/*.min.js']
}

//delete the output file(s)
gulp.task('clean', function () {
//del is an async function and not a gulp plugin (just standard nodejs)
//It returns a promise, so make sure you return that from this task function
// so gulp knows when the delete is complete
return del(['app/all.min.js']);
});

// Combine and minify all files from the app folder
// This tasks depends on the clean task which means gulp will ensure that the
// Clean task is completed before running the scripts task.
gulp.task('scripts', ['clean'], function () {

return gulp.src(config.src)
.pipe(uglify())
.pipe(concat('all.min.js'))
.pipe(gulp.dest('app/'));
});

gulp.task('watch', function () {
return gulp.watch(config.src, ['scripts']);
});

//Set a default tasks
gulp.task('default', ['scripts'], function () { });

这是任务运行程序资源管理器:

enter image description here

下面是任务运行器资源管理器在上面教程站点中的外观:

enter image description here

知道为什么我在任务运行程序资源管理器中看不到子任务吗?

最佳答案

这是迄今为止我能够解决此问题的唯一方法。

添加任务后,将 gulpfile 重命名为其他名称,然后关闭 Task Runner Explorer。

将重命名的文件更改回 gulpfile.js,然后重新打开 Task Runner Explorer。

您应该会看到您的 gulpfile 任务已更新。

关于gulp - 为什么我的任务运行程序资源管理器中未创建子任务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36422713/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com