A complete Angular 6 and Webpack 4 starter seed with minimal and full featured branches. Full featured branch includes: Material Design 2 (Bootstrap 4 branch available as well), @ngrx, HMR, DLLs and optional use of Universal for server-side rendering - Supports AOT (offline) compilation, sync and lazy loading. Karma/Protractor for e2e/unit tests.
Featuring Material Design 2, Webpack (and Webpack DLL plugin for faster dev builds), HMR (Hot Module Replacement), @ngrx for state management and optional server-side rendering with Universal.
git clone https://github.com/qdouble/angular-webpack-starter.git
cd angular-webpack-starter
yarn
yarn start
Use yarn start
for dev server. Default dev port is 3000
.
Use yarn run start:hmr
to run dev server in HMR mode.
Use yarn run build
for production build.
Use yarn run server:prod
for production server and production watch. Default production port is 8088
.
Use yarn run universal
to run production build in Universal. To run and build universal in AOT mode, use
yarn run universal:aot
. Default universal port is 8000
.
Default ports and option to use proxy backend for dev server can be changed in constants.js
file.
To create AOT version, run yarn run build:aot
. This will compile and build script.
Then you can use yarn run prodserver
to see to serve files.
There is also an option to use store-logger which outputs ngrx action history to the console.
To set your development mode store logging preference, go to the constant.js file and edit the STORE_DEV_TOOLS
constant.
Available options are logger | none
HMR mode allows you to update a particular module without reloading the entire application.
The current state of your app is also stored in @ngrx/store allowing you to make updates to your
code without losing your currently stored state.
The following are some things that will make AOT compile fail.
For unit tests, use yarn run test
for continuous testing in watch mode and use
yarn run test:once
for single test. To view code coverage after running test, open coverage/html/index.html
in your browser.
For e2e tests, use yarn run e2e
. To run unit test and e2e test at the same time, use yarn run ci
.
Recommended Steps for merging this starter into existing project