Permalink
85 lines (57 sloc) 2.04 KB

Getting Started

If you've previously installed gulp globally, run npm rm --global gulp before following these instructions. For more information, read this Sip.

Check for Node and npm

Make sure that you've installed Node and npm before attempting to install gulp.

node --version
npm --version

Install the gulp command

npm install --global gulp-cli

Create a package.json in your project directory

If you don't have a package.json, create one. If you need help, run an npm init which will walk you through giving it a name, version, description, etc.

Install gulp in your devDependencies

Run this command in your project directory:

npm install --save-dev gulp@next

Create a gulpfile

In your project directory, create a file named gulpfile.js in your project root with these contents:

var gulp = require('gulp');

gulp.task('default', defaultTask);

function defaultTask(done) {
  // place code for your default task here
  done();
}

Test it out

Run the gulp command in your project directory:

gulp

To run multiple tasks, you can use gulp <task> <othertask>.

Result

Voila! The default task will run and do nothing.

Using gulpfile ~/my-project/gulpfile.js
[11:15:51] Starting 'default'...
[11:15:51] Finished 'default' after 103 μs

.src, .watch, .dest, .parallel, .series, CLI args - How do I use these things?

For API specific documentation, you can check out the documentation for that.

Where do I go now?