Build Commands
Production Build
Create an optimized production build:dist/odontologia-frontend/ directory.
Development Build with Watch
Build in development mode with automatic rebuilds:ng build --watch --configuration development, which rebuilds the application whenever source files change.
Build Configurations
The project defines two build configurations inangular.json:
Production Configuration
Optimized for performance and size:- Output Hashing: All files include content hashes for cache busting
- Budget Limits: Enforces bundle size constraints
- Initial bundle: 500kB warning, 1MB error
- Component styles: 4kB warning, 8kB error
- Optimization: Full minification and tree-shaking
- License Extraction: Third-party licenses extracted
Development Configuration
Optimized for debugging:- No Optimization: Faster builds, easier debugging
- Source Maps: Full source map generation
- No License Extraction: Faster build time
Build Architecture
The project uses @angular/build:application builder with the following configuration:Entry Points
- browser:
src/main.ts- Client-side application - server:
src/main.server.ts- Server-side application - ssr.entry:
src/server.ts- Express server entry
Output Mode
The build uses"outputMode": "server", which generates both browser and server bundles for SSR support.
Assets
Static assets are copied from thepublic/ directory:
Styles
Global styles are bundled in order:- Boxicons CSS:
node_modules/boxicons/css/boxicons.min.css - Application styles:
src/styles.css
Build Output Structure
TypeScript Compilation
The build uses TypeScript 5.9.2 with strict mode enabled:- strict: true
- noImplicitOverride: true
- noPropertyAccessFromIndexSignature: true
- noImplicitReturns: true
- noFallthroughCasesInSwitch: true
- strictInjectionParameters: true (Angular)
- strictInputAccessModifiers: true (Angular)
- strictTemplates: true (Angular)
Target
- target: ES2022
- module: preserve
Bundle Budgets
The production build enforces size budgets to maintain performance:| Bundle Type | Warning | Error |
|---|---|---|
| Initial | 500kB | 1MB |
| Component Style | 4kB | 8kB |
Serving the Production Build
After building, serve the SSR application:http://localhost:4000.
Build Performance Tips
- Use Development Configuration: Faster builds during development
- Enable Watch Mode: Automatic rebuilds save time
- Optimize Dependencies: Keep dependencies up to date
- Monitor Bundle Size: Stay within budget limits
Next Steps
- Configure Server-Side Rendering
- Review Code Style Guidelines
- Learn about Contributing