Gulp

Version Date Notes By
0.1 2017-11-15 Initial release JFM

Gulp is a toolkit for automating tasks in your development workflow such as:

  • Loading a web server
  • Reloading the browser automatically whenever a file is saved
  • Transpile js files from ES6 to ES5
  • Optimizing assets like CSS, JavaScript, and images
  • Create bundles
  • Etc...

You can run the tasks by executing the command gulp <task> Our framework has a set of tasks to help us on our daily development framework, some task are to be run directly by the command line other are support taks that are executed by other tasks.

Is this document we will only approach some of the basic tasks used directly on the command line.

gulp watch

gulp watch will build the project (transpile js files, minify, etc..) created a server and watch all the files in the src folder for changes. When a file is changed it will refresh the browser by using the browserSync

gulp watch-bundle

This does the same as gulp watch but will only watch for changes base on the folders defined on the watches.js file and will bundle all the other folders

The watches.js file contains an array where you can set the folders you only want to watch, the names are of the folder names on the src/modules/ folder. You can also spefify to watch the common/ folder and the files at the src/ folder

Example watche.js

module.exports = {
    "watch": ["suppliers", "common", "root"],
}

gulp export

The gulp export creates a production ready set of files on the export folder. This folder can be used to install or update any instalation.