GitHub repository: y858363747/Angular-Project-Workflow
Primary language: JavaScript
Description: Important - Read before proceeding!  With the latest update to Angular 5, some adjustments to the prod workflow are required to make lazy loading + aot compilation work again. Make sure to implement the following steps AFTER going through the next lectures. Running the workflow as we set it up there will break, but no worries only very few steps are required.  0) Make sure you're using Webpack version 3: npm install --save-dev webpack@3   1) Install one extra dev-dependency: @ngtools/webpack   npm install --save-dev @ngtools/webpack   2) Remove outDir  from tsconfig.aot.json   3) Update webpack.config.prod.js  Add one import at the top (e.g. right after importing webpack.config.common ):  var ngw = require('@ngtools/webpack'); Add one extra rule (right before the old rule we had there - don't delete the old rule!):  {   test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,   loader: '@ngtools/webpack' }, Add one extra plugin (right before the old plugin we had there - don't delete that old plugin!):  new ngw.AngularCompilerPlugin({   tsConfigPath: './tsconfig.aot.json',   entryModule: './src/app/app.module#AppModule' }), 4) Update the build:prod  script to look like this (only the cleanup part - del-cli - changed a bit):  "build:prod": "del-cli dist && ngc -p tsconfig.aot.json && ngc -p tsconfig.aot.json && webpack --config webpack.config.prod.js --progress --profile --bail && del-cli 'src/app/**/*.js' 'src/app/**/*.ngfactory.ts' 'src/app/**/*.js.map' 'src/app/**/*.shim.ts' 'src/app/**/*.ngsummary.json' 'src/app/**/*.ngstyle.ts' 'dist/app' 'src/polyfills.ngsummary.json'", With these steps, npm run build:prod  should work fine.