gulp-grunt
gulp-grunt copied to clipboard
Using gulp-grunt my task never end.
Hi,
Using require('gulp-grunt')(gulp);
my other gulp task and grunt-task never end.
What's your Gruntfile's block like? You have to return the stream, e.g.:
gulp.task('clean', function() {
return gulp.start('grunt-clean:dist');
});
I have this also, Just including grunt into the gulp file prevents the gulp functions from ending. i.e. running them individually. Are you saying to just put return on every grunt task will solve this also ? This is not possible in my scenario as I am using "gulpsync" to coordinate steps.
@Smurf-IV Not quite. This setup works for me:
var gulp = require('gulp');
require('gulp-grunt')(gulp);
gulp.task('default', function() {
return gulp.start('grunt-default');
});
gulp.task('serve', ['grunt-default'], function() {
gulp.start('watch');
});
gulp.task('watch', function() {
gulp.watch('**/*.js', function() {
gulp.start('grunt-gulp:build');
});
});
Previously, using grunt = require('gulp-grunt')
did not work.
Gulp.start is new for me. I was following the documentation https://github.com/gulpjs/gulp/blob/master/docs/API.md#deps
gulp.task('build', ['array', 'of', 'task', 'names']);
If I comment out
require('gulp-grunt')(gulp);
then my individual gulp tasks exit when they have finished.
Putting it back in and using as you have suggested:
gulp.task('default', function() {
return gulp.start('grunt-default');
});
Stop the gulp tasks from exiting. (i.e. not even running the grunt task)