A minimal example using the Angular compiler cli to pre-compile component templates.
build/ // contains results of AoT compilation
dist/ // contains final minified production artifacts
src/
|__app/
|__home/
|__index.html
|__main.aot.ts // entry point for production (AoT) builds
|__main.jit.ts // entry point for development (JiT) builds
|__polyfills.ts
Executing npm run build will:
- Perform AoT compilation and output the results to the ./build folder
- Bundle and minify the app sources to the ./dist folder
| Command | Description |
|---|---|
| npm start | Start the webpack development server @ localhost:3000 |
| npm run build | Perform AoT compilation; bunde and minify to ./dist folder |
| npm run server | Serve the production artifacts from ./dist folder @ localhost:3000 |