Submodule 11.3: Building the application

  • dist folder
  • Minify
  • Concatenate
  • Uglify

Preparing the Distribution Folder I

Preparing the Distribution Folder II

Then, install the usemin-cli, cssmin, uglifyjs and htmlmin NPM packages as follows:

npm install --save-dev usemin-cli cssmin uglifyjs htmlmin

Then, set up in package.json the following scripts:

"usemin": "usemin contactus.html -d dist --htmlmin -o dist/contactus.html && usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html && usemin menu.html -d dist --htmlmin -o dist/menu.html && usemin index.html -d dist --htmlmin -o dist/index.html", 

"build": "npm run clean && npm run imagemin && npm run copyfonts && npm run usemin"