1. Install Node.js
First of all, you need download and install node.js (which includes npm). npm stands for node packaged modules and is a way to manage development dependencies through Node.js. You can check it in your terminal window using these commands node --version
and npm --version
. You can download Node.js here.
2. Install Dependencies
Before using gulp, we need go to the template folder (./HTML/
), installing the dependencies.
$ npm install
3. Gulp Installation
Installation of Gulp is done with the command:
$ npm install -g gulp
4. Build project
To build your project from the source files use next command:
$ npm start
Please keep in mind that npm start
command delete and then create build/ folder again based on your source files.
Main Gulp Tasks
- build Creates the dist folder by compiling all assets.
- default Runs the build and server tasks detailed above.
- deploy Runs the build and deploy tasks detailed above.
Core Gulp Tasks
- reset Deletes the dist folder so the build can start fresh.
- copy Copies the necessary files from src to dist.
- pages Compiles Handlebars templates with Panini.
- server Creates a server with BrowserSync and watch for file changes.
- sass Compiles Sass to CSS.
- js Concatenate and minify JS.
- lint-js Check JS code for errors.
- sprites Creates sprites from SVG files.
- img Compresses images
- bootstrap Compiles Bootstrap.
- ftp-deploy Deploy to FTP.
- build Creates the dist folder by compiling all assets.
- default Runs the build and server tasks detailed above.
- deploy Runs the build and deploy tasks detailed above.