aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
256 stars 124 forks source link

GULP Tasks not running after update visual studio and dot net core tools #794

Open jln1989 opened 8 years ago

jln1989 commented 8 years ago

Hi,

After installing the latest visual studio update, dot net core and .net core tool (preview 2), we are noticing that the GULP tasks are not running automatically. This is happening for a team of 65 people and we are finding it really difficult. Any help in this matter would be appreciated.

We did not change the gulp file in a while and we are having default task which looks into a watch. Please find the sample below.

It is working perfectly fine when runnign via CMD.

// Task 1
gulp.task("minjs", function () {
    return gulp.src(scriptsArr)
        .pipe(concat("Sample.min.js))
        .pipe(uglify())
        .pipe(gulp.dest(paths.distjs));

});

// Task 2
gulp.task("concatjs", function () {
    return gulp.src(scriptsArr)
        .pipe(concat("sample.js"))
        .pipe(gulp.dest(paths.distjs));
});

//Watch task
gulp.task("watch", ["concatjs", "minjs"], function () {
    gulp.watch([paths.srcjs + "**/*.js"], ["concatjs", "minjs"]);
});

// Default Task
gulp.task("default", ["watch"]);
mlorbetske commented 8 years ago

@jodavis any ideas?

jodavis commented 8 years ago

@jln1989 How does your team run the Gulp task? Is it bound to an event in the Task Runner Explorer, or do you manually start it in the Task Runner Explorer?

jln1989 commented 8 years ago

@jodavis It is bound to after build event and it has been like that since RC1. I would like to know how do i trigger the gulp default task when any of the JS files is changed.

It used to happen before the VS update and its not happening now.

jodavis commented 8 years ago

@jln1989 You can bind the watch task to the Project Open event in TRX. That will start the watch process right away, so that concatjs and minjs will run any time a file matching **/*.js is changed on disk. (You don't want your default task to run on every change, because that would start multiple watch processes that would all respond to changes on disk simultaneously.)

I don't know how binding to After Build would have worked in prior releases, unless there was an early build that happened during project open.