Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Latest commit

 

History

History
executable file
·
25 lines (14 loc) · 1.23 KB

File metadata and controls

executable file
·
25 lines (14 loc) · 1.23 KB

Lab: Run the Build Command and NPM Scripts

Scenario

Time: 10 minutes

Building apps within an Nx Workspace is done with the Angular CLI ng build command and using the --app option for targeting the app to build (along with any other options).

Try out building the apps in the project and investigate the build artifacts as you use different build option flags. Also try out the npm scripts that Nx provides to only build affected apps and to format code.

Instructions

  1. Run the Angular CLI build command and use the -a option to target different apps in the workspace by name.

  2. Explore the dist dir to see the results.

  3. Run build again for an app with the --prod option flag, examine the results in the dist dir.

  4. Run build for an app with --prod and --build-optimizer option flags, examine the results in the dist dir.

  5. Run the npm script affected:apps and target the SHAs 1ee3a41 and b88bc46 (remember, you can use -- to pipe additional args through to the npm script).

  6. Test out the npm script format by making some formatting changes to an app or lib file and then running the script.

Next Lab

Go to Optimizing Performance Lab #1: Lighthouse Analysis