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.
-
Run the Angular CLI
build
command and use the-a
option to target different apps in the workspace by name. -
Explore the
dist
dir to see the results. -
Run
build
again for an app with the--prod
option flag, examine the results in thedist
dir. -
Run
build
for an app with--prod
and--build-optimizer
option flags, examine the results in thedist
dir. -
Run the npm script
affected:apps
and target the SHAs1ee3a41
andb88bc46
(remember, you can use--
to pipe additional args through to the npm script). -
Test out the npm script
format
by making some formatting changes to an app or lib file and then running the script.
Go to Optimizing Performance Lab #1: Lighthouse Analysis