Webpack 3 configuration to compile and test Angular 4 application with lazy loading modules
# Clone the repo
git clone https://github.com/adrigardi90/AngularWebpackCompilation.git
# Change into the repo directory
cd AngularWebpackCompilation
# install
npm install
In Development mode we use JiT compilation. Css are included in the head tag. The ouput is in the /compiled folder
# build dev mode
npm run build-dev
In Production mode we use AoT compilation with Tree Shaking. Css are included in one separated file. The ouput is in the /compiled folder
# build production mode
npm run build-production
We can serve the compile application from /compiled with http-server
# serve compiled app
npm run serve
We use Karma & Jasmine to testing. The coverage reporter is in the /coverage folder
# run test
npm run test
We can serve src folder and develop with hot reloading using webpack-dev-server
# start application
npm run start