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,
- Download stable version of Node.js (LTS) from nodejs.org
- 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
-
Open command line interface and
cd
into the root of/merit
project directory. -
Run below command
to install all of merit's dependencies listed in
package.json
npm install
Gulp commands
gulp
-
Use
gulp
command to lauch the project.gulp
-
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
-
Use
gulp dist
command to compile and minify source files from./src/
folder into./dist/
folder to generate production files.gulp dist
-
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
-
Use
gulp build
command to compile source files from./src/
folder into./build/
folder to generate unminified files. This command is likegulp
command without watch and launch function.gulp build
-
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.