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
cdinto the root of/meritproject directory. -
Run below command
to install all of merit's dependencies listed in
package.jsonnpm install
Gulp commands
gulp
-
Use
gulpcommand 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
/devfolder where the server is running.
Press Control + C to quit from localhost.
gulp dist
-
Use
gulp distcommand to compile and minify source files from./src/folder into./dist/folder to generate production files.gulp dist -
This command will generate
./distfolder 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 buildcommand to compile source files from./src/folder into./build/folder to generate unminified files. This command is likegulpcommand without watch and launch function.gulp build -
This command will generate
./buildfolder 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.