node package manager

gulp-flow

gulp-flow

gulp-flow helps to organize and re-use a collection of tasks. This is the basic package to create a more sophisticated workflow.

Requirements

  • >= Node v4 (v4 or +)
  • >= Gulp v4 (v4 or +)

Install

gulp-flow requires Gulp 4.

Install Gulp 4 (if not already installed)

If Gulp 4 is already installed, you can skip this step (go to install gulp-flow) ūüĎć

Uninstall previous Gulp installation (if there is a Gulp installed less than v4)

npm uninstall gulp -g
cd [your_project_root]
npm uninstall gulp

Install Gulp 4 CLI tools globally from 4.0 GitHub branch

npm install gulpjs/gulp-cli#4.0 -g

Install Gulp 4 into your project

npm install --save-dev gulpjs/gulp.git#4.0

Install Gulp flow

npm install --save-dev gulp-flow

Usage

let flow = require('gulp-flow');

Command

If you are a Unix user, to be able to support natively the modern JS features (ES6 / ES7) in your tasks scripts (without transpiler), you can add in your .bashrc (or .bash_aliases) file this alias:

# run Gulp with some features of ES6/ES7 
alias gulp='node --es_staging --harmony_destructuring `which gulp`'

Now you can write the modern JS (supported by Node.js) in your gulpfile.js:

let {cfg, gp, pipes, utils, envList} = require('gulp-flow');

Config

TODO: cfg

Environment

gulp-flow use the envlist module to finely manage and consolidate the environments.

See envlist module for more details.

gulp --type=dev

or

APP_ENV=dev gulp

or

NODE_ENV=dev gulp

gulpfile.js

// cfg.env output: dev 
console.log(cfg.env);
 
// NODE_ENV output: development 
// Why? Because it's a convention of the Node.js sphere ;) 
// See envlist module for more details 
console.log(process.env.NODE_ENV);
console.log(flow.envList.NODE_ENV);

Also you can ensure the environment directly in your tasks with flow.envList.ensure() or the shortcut flow.ensureEnv().

Gulp plugins

TODO: gp

Pipes

TODO: pipes

Bundles

TODO: bundles

Utils

TODO: utils

LICENSE

MIT (c) 2016, Nicolas Tallefourtane.

Author

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal