{"id":15041642,"url":"https://github.com/rachitbhasin/angular4-webpack-aot-starter","last_synced_at":"2026-01-06T22:38:49.976Z","repository":{"id":196613886,"uuid":"86330604","full_name":"rachitbhasin/Angular4-webpack-AOT-starter","owner":"rachitbhasin","description":"Angular 4, webpack and AOT seed project","archived":false,"fork":false,"pushed_at":"2017-08-03T12:49:00.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T14:45:08.798Z","etag":null,"topics":["angular","angular-cli","angular4","aot","aot-compilation","aot-loader","certificate","express","http2","node-sass","sass","server-push","spdy","typescript","webpack","webpack2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rachitbhasin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-27T12:06:17.000Z","updated_at":"2020-08-09T13:40:13.000Z","dependencies_parsed_at":"2023-09-26T14:49:25.283Z","dependency_job_id":null,"html_url":"https://github.com/rachitbhasin/Angular4-webpack-AOT-starter","commit_stats":null,"previous_names":["rachitbhasin/angular4-webpack-aot-starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rachitbhasin%2FAngular4-webpack-AOT-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rachitbhasin%2FAngular4-webpack-AOT-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rachitbhasin%2FAngular4-webpack-AOT-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rachitbhasin%2FAngular4-webpack-AOT-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rachitbhasin","download_url":"https://codeload.github.com/rachitbhasin/Angular4-webpack-AOT-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245822336,"owners_count":20678165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-cli","angular4","aot","aot-compilation","aot-loader","certificate","express","http2","node-sass","sass","server-push","spdy","typescript","webpack","webpack2"],"created_at":"2024-09-24T20:46:19.350Z","updated_at":"2026-01-06T22:38:49.926Z","avatar_url":"https://github.com/rachitbhasin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular 4 Ahead-of-Time (AoT) Compilation\n\nA minimal example using the Angular compiler cli to pre-compile component templates.\n\nNode version\n------------\n\n```\n6.x.x\n```\n\nFiles \u0026 Directories\n-------------------\n\n```\nbuild/           // contains results of AoT compilation\ndist/            // contains final minified production artifacts\nserver/          // contains configuration files for express/spdy server\n |__ certs       // contains self-signed SSL certificates for https\n main.js\nsrc/\n |__app/\n |__index.html\n |__main.aot.ts  // entry point for production (AoT) builds\n |__main.jit.ts  // entry point for development (JiT) builds\n |__polyfills.ts\n```\n\n\nGenerating Production Artifacts\n-------------------------------\n\nExecuting `npm run build` will:\n\n1. Perform AoT compilation and output the results to the **./build** folder\n2. Bundle and minify the app sources to the **./dist** folder\n\n\nServing Production Artifacts\n----------------------------\n\nThe AOT build is served using express and spdy(http/2) with server push to load bundle.js and polyfills.js. \nThis requires self-signed SSL certificate to be created as the application is served over https.\n\n1. Use the following commands to create a certificate.\n2. Place the certificates in the **server/certs** folder\n\n```\n$ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048\n...\n$ openssl rsa -passin pass:x -in server.pass.key -out server.key\nwriting RSA key\n$ rm server.pass.key\n$ openssl req -new -key server.key -out server.csr\n...\nCountry Name (2 letter code) [AU]:IN\nState or Province Name (full name) [Some-State]:Delhi\n...\nA challenge password []:\n...\n$ openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt\n```\n\nExecuting `npm run server` will serve the app from the **./dist** folder over http/2.\n\nNPM Commands\n------------\n\n|Command|Description|\n|---|---|\n|npm start|Start the webpack development server @ **localhost:3000**|\n|npm run build|Perform AoT compilation; bunde and minify to **./dist** folder|\n|npm run clean|Delete **./dist** \u0026 **./build** folders|\n|npm run server1|Serve the production artifacts from **./dist** folder using HTTP1.1 @ http://localhost:3000 |\n|npm run server2|Serve the production artifacts from **./dist** folder using HTTP2 @ https://localhost:3000 |\n|npm run clean:build|Run in serial **npm run clean** and **npm run build**|\n|npm run cbs1|Run in serial **npm run clean**, **npm run build** and **npm run server1**|\n|npm run cbs2|Run in serial **npm run clean**, **npm run build** and **npm run server2**|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frachitbhasin%2Fangular4-webpack-aot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frachitbhasin%2Fangular4-webpack-aot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frachitbhasin%2Fangular4-webpack-aot-starter/lists"}