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-portalIn this section, we will run some analysis tools to inspect the size of our application.
Install the webpack-bundle-analyzer
npm install --save-dev webpack-bundle-analyzerOnce installed add the following entry to the npm scripts in the 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-jsonRun the following command
npm run bundle-report-customer-portalRun the Nx dep graph tool
nx dep-graphLast updated