Build Commands
The project includes several build scripts defined inpackage.json:
package.json
Development Build
For development builds with debugging capabilities:Development Configuration
The development configuration (fromangular.json) includes:
angular.json
- No optimization: Faster builds, easier debugging
- Source maps: Map compiled code back to TypeScript source
- No license extraction: Speeds up build time
- Watch mode: Automatically rebuilds on file changes
Use development builds for local testing and debugging. Source maps make it easier to trace errors to their source.
Production Build
For optimized production builds:Production Configuration
The production configuration is the default and includes:angular.json
- Optimization: Minification, tree-shaking, and dead code elimination
- Output hashing: All files get content-based hashes for cache busting
- Bundle budgets: Size limits to prevent bundle bloat
- License extraction: Third-party licenses extracted to separate file
Bundle Budgets
The project enforces size limits to maintain performance:| Bundle Type | Warning | Error |
|---|---|---|
| Initial bundle | 500kB | 1MB |
| Component styles | 4kB | 8kB |
- Application code
- Angular framework
- Third-party dependencies
- Runtime and polyfills
If you exceed budget warnings, consider:
- Lazy loading feature modules
- Analyzing bundle with
ng build --stats-json - Removing unused dependencies
- Using lighter alternatives to heavy libraries
Output Directory
Builds are output to:Server-Side Rendering Build
The project includes SSR (Server-Side Rendering) support:angular.json
dist/portafolio/server/server.mjs.
Build Options
Watch Mode
Automatically rebuild on file changes:Configuration Selection
Manually specify a configuration:Stats File
Generate bundle analysis data:dist/portafolio/stats.json which can be analyzed with tools like webpack-bundle-analyzer.
TypeScript Compilation
The build uses TypeScript configuration fromtsconfig.app.json, which extends the base tsconfig.json:
- Target: ES2022
- Strict mode: Enabled
- Experimental decorators: Enabled for Angular
- Isolated modules: True for faster builds
Next Steps
- Learn about testing the application
- Review deployment options
- Understand the project architecture