The following Gulp setup does not work:
var templateCache = require("gulp-angular-templatecache");
var less = require("gulp-less");
gulp.task("angular-templates", function(){
return gulp.src(TEMPLATES_SOURCES)
.pipe(templateCache(TEMPLATES_JS, {module: "moonwalk", root: TEMPLATES_ROOT}))
.pipe(gulp.dest("Temp/"));
});
gulp.task("less-compile",function(){
return gulp.src("**/*.less")
.pipe(less())
.pipe(gulp.dest("./"));
});
gulp.task("release-assets", ["angular-templates", "less-compile"], function() {
return gulp.src("./Content/**/*.cshtml")
.pipe(gulp.dest("Dist/"));
});
When I run gulp release-assets, the output is as follows:
[01:24:06] Starting 'angular-templates'...
[01:24:06] Starting 'less-compile'...
[01:24:06] Finished 'angular-templates' after 605 ms
... not good...
However, if I changed the second task, deleting it returnas follows:
gulp.task("less-compile",function(){
gulp.src("**/*.less")
.pipe(less())
.pipe(gulp.dest("./"));
});
Then the setup works !? The output is gulp release-assetsthen as follows:
[01:21:54] Starting 'angular-templates'...
[01:21:54] Starting 'less-compile'...
[01:21:54] Finished 'less-compile' after 2.89 ms
[01:21:54] Finished 'angular-templates' after 741 ms
[01:21:54] Starting 'release-assets'...
[01:22:03] Finished 'release-assets' after 8.9 s
I do not understand this problem. I thought for the stream that is provided gulp.src()?
is necessary returnCan someone explain why this setting does not work if I go back to gulp.src()?
source
share