Angular 2 boilerplate with ability to
- start a local CDN server,
- generate custom fonts using webfont,
- generate bundles for production environment using Webpack
- use SCSS for styling
- use webpack for bundling
- use Angular 2 lazy loading with AOT and HMR
- npm for package manager
- TypeScript for the base language
- Typings for TypeScript definition manager
- Yarn for installing dependencies with caching
- Webpack for generating build
You need to have Node.js and npm
- Support Node v4 - latest
- Support npm v3 - latest
- Yarn (Optional) using npm install -g yarn
- Install Dependency Checker (Optional)
npm install -g depcheck
- Go to the starter directory and install the packages (using npm):
npm install
- Go to the starter directory and install the packages (using yarn): (Optional)
yarn
For generating a build directory with all the app files bundled, run this command.
Note: The build directory is neither under watch and nor is any file updated in build directory on any change.
Run npm run build for refreshing the build directory completely
npm run build:dev
You can create prod build by running:
npm run build:prod
You can create prod build with AOT compilation by running:
npm run build:aot:prod
For starting up the local CDN server, run:
npm start server:dev
and done! The browser will popup and you can start to see your app!
Every changes to the files (ts/scss/html) will refresh the browser automatically
and it'll also compile your changed TypeScripts files to Javascript files.
For adding external scss files to main.css, add them to
/
|- src/assets/styles/main.scss
For adding external css files to vendor.css, add them to following file and generate build:
/
|- src/assets/styles/vendor.ts
For adding a new icon, just add the equivalent svg file to below path and generate build
/
|- src/assets/custom-icons
To enable debug mode: add this json config in localStorage.
- remoteServerUrl: is where the ajax requests hit in case you wish to set it/override it.
- remoteCDNUrl: is where the requests for js/css/html goes in case you wish to set it/override it.
"bootConfig": {
"remoteCDNUrl": "http://localhost:3000/build/",
"remoteServerUrl": "http://test.com:8080"
}
npm run doc