Overview
Runningng build compiles the Angular application, runs the TypeScript compiler, bundles all modules, and writes the output to the dist/ directory. The build process is configured in angular.json and varies depending on the target configuration.
Build commands
Development vs. production builds
- Development
- Production
Running
ng build without a configuration flag uses the default development settings:- No minification — output is readable for debugging
- Source maps included
- JIT (Just-in-Time) compilation
- Faster build times
Build output
After a successful build, thedist/ directory contains everything needed to serve the application:
| File | Description |
|---|---|
index.html | Entry point for the application |
main.js | Bundled application code (hashed filename in production) |
styles.css | Global stylesheets (hashed filename in production) |
assets/ | Static assets copied as-is from src/assets/ |
In a production build, filenames include a content hash (e.g.,
main.abc123.js). This enables long-term browser caching: files only change their names when their content changes, so browsers can safely cache them indefinitely.Deployment
The contents ofdist/gems-lms-web/ are a static site. Deploy them by copying the directory to any static web server or CDN:
index.html for all routes so that client-side routing works correctly. On nginx, this is done with a try_files $uri $uri/ /index.html; directive.