18 - Deploying An Nx Monorepo

The AngularCLI only generates bundles. This means that we cannot build the lib itself. We can only do it by building an app that depends on it.

And then run

nx build --prod customer-portal

In this section, we will run some analysis tools to inspect the size of our application.

npm install  --save-dev webpack-bundle-analyzer
  • Once installed add the following entry to the npm scripts in the package.json:

package.json
"bundle-report-customer-portal": "webpack-bundle-analyzer dist/apps/customer-portal/stats.json"
  • Rebuild with --stats-json

nx build --prod customer-portal --stats-json
  • Run the following command

npm run bundle-report-customer-portal
  • Run the Nx dep graph tool

nx dep-graph

Last updated