Skip to content

Instantly share code, notes, and snippets.

@leftieFriele
Last active August 29, 2015 14:01
Show Gist options
  • Save leftieFriele/28444b642db669e8d11f to your computer and use it in GitHub Desktop.
Save leftieFriele/28444b642db669e8d11f to your computer and use it in GitHub Desktop.
My learnings from Gulp
===============================
Useful modules
===============================
* gulp-debug (https://www.npmjs.org/package/gulp-debug) - get a better overview of what's going on with files
===============================
Debugging
===============================
This one dumps errors with stack trace. Just drop this in your file somewhere and you'll get all the error from tasks running, also from other modules which aren't gulp plugins.
gulp.on('err', function(e) {
console.log(e.err.stack);
});
===============================
Asynch
===============================
If you have some tasks that must be run, you can use the dependency system in gulp
gulp.task('my-task', ['dependent-task'], function(){...]);
You can of course add a control flow library and stuff, but I'd think the built in should be enough and there are plans on making this easier in Gulp core module.
Returning from a task is the current way to make tasks synchronous.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment