Build Tools

merit build tools provides easy package management and production deployment for any type of web application and comes with powerful asset bundle tools with custom bundling for production.


Preparing the environment

Step 1: Install Node.js

To install Node.js,

  1. Download stable version of Node.js (LTS) from nodejs.org
  2. Launch the installation program and install Node with all default settings
Step 2: Install Gulp

merit uses Gulp to automate & enhance your development workflow, leverage gulp and the flexibility of JavaScript to automate slow, repetitive workflows.

Run below command in your terminal to install gulp command line utility globally.

npm install gulp-cli -g

Step 3: Install required packages
  1. Open command line interface and cd into the root of /merit project directory.
  2. Run below command to install all of merit's dependencies listed in package.json
    npm install

Gulp commands

gulp
  1. Use gulp command to lauch the project.
    gulp
  2. It starts a server with new tab in your default browser. Any changes from the source files are instantly compiled and the browser will be updated automatically with the help of Browsersync. This command will create a /dev folder where the server is running.

Press Control + C to quit from localhost.

gulp dist
  1. Use gulp dist command to compile and minify source files from ./src/ folder into ./dist/ folder to generate production files.
    gulp dist
  2. This command will generate ./dist folder with all the CSS and JavaScript files compiled and minified. It also minifies and concatenates all used JavaScript vendor files and creates merit-vendor.js. In addition it will compile and minify HTML files as well.
gulp build
  1. Use gulp build command to compile source files from ./src/ folder into ./build/ folder to generate unminified files. This command is like gulp command without watch and launch function.
    gulp build
  2. This command will generate ./build folder with all the CSS and JavaScript files compiled. It also concatenates all used JavaScript vendor files and creates merit-vendor.js. In addition it will compile HTML files as well.