Angular Custom Build Scripts

From package.json

Example: Build a custom build script.

In the example add deploy”: “ng build –base-href \”/app/\” –prod”,

  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "deploy": "ng build --base-href \"/app/\" --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },

From the command line just enter:

npm run deploy

This will execute ng build –base-href “/app/” –prod

WARNING: Do not use single quotes for the CLI commands.