Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using gulp-grunt my task never end. #24

Open
nathanredblur opened this issue Jan 21, 2016 · 5 comments
Open

Using gulp-grunt my task never end. #24

nathanredblur opened this issue Jan 21, 2016 · 5 comments

Comments

@nathanredblur
Copy link

Hi,
Using require('gulp-grunt')(gulp); my other gulp task and grunt-task never end.

@rebelliard
Copy link

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');
});

@Smurf-IV
Copy link

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.

@rebelliard
Copy link

@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.

@nathanredblur
Copy link
Author

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']);

@Smurf-IV
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants