Enterprise Angular Applications with NgRx and Nx
  • Introduction
  • Introduction
    • Introduction
    • Course Description
    • Resources
    • 0 - Environment Setup
    • 1a - Brief Introduction To Angular
    • 1b - Brief Introduction To Angular
    • 1c - Brief Introduction To Angular
    • 2 - Creating an Nx Workspace
    • 3 - Generating components and Nx lib
    • 4 - Add JSON server
    • 5 - Angular Services
    • 6 - Angular Material
    • 7 - Reactive Forms
    • 8 - Layout Lib and BehaviorSubjects
    • 9 - Route Guards and Products Lib
    • 10 - NgRx Introduction
    • 11 - Adding NgRx to Nx App
    • 12 - Strong Typing the State and Actions
    • 13 - NgRx Effects
    • 14 - NgRx Selectors
    • 15 - Add Products NgRx Feature Module
    • 16 - Entity State Adapter
    • 17 - Router Store
    • 18 - Deploying An Nx Monorepo
Powered by GitBook
On this page
  1. Introduction

18 - Deploying An Nx Monorepo

Previous17 - Router Store

Last updated 3 years ago

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.

  • Install the

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
webpack-bundle-analyzer