Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 983 Bytes

19-deploying-an-nx-monorepo.md

File metadata and controls

45 lines (29 loc) · 983 Bytes

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:

{% code title="package.json" %}

"bundle-report-customer-portal": "webpack-bundle-analyzer dist/apps/customer-portal/stats.json"

{% endcode %}

  • 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