This project was generated with Angular CLI version 7.1.0.
Live Demo is running on now.sh.
This starter kit contains all the minimal tooling and configuration you need to kick off your next universal Angular 7 project.
It combines @angular/cli and udk to won't have to write specific code for development purposes only.
- angular 7 as universal web application platform
- module-map-ngfactory-loader 7 as server side rendering of lazy routes
- angular/cli 7 as code scaffolder
- webpack 4 as module bundler
- node as server
- express as request handler
- udk-builder as architect builder
- ng-udkc as extreme live development container to reload all the things!
- webpack/hot/poll to enable hmr on server side
- webpack-hot-middleware (dynamically mounted on server) and @angularclass/hmr to enable hmr on browser side
- watchpack to restart dev container when a metafile changed
Important: HMR doesn't work yet on server side with lazy routes (but works in browser side). We are trying to find a way which fixes this issue and we're still opened for possible solutions.
git clone https://github.com/enten/angular-universal my-project
cd my-project
npm install
npm startBranch material
git clone https://github.com/enten/angular-universal -b material my-project
cd my-project
npm install
npm startBranch toh
git clone https://github.com/enten/angular-universal -b toh my-project
cd my-project
npm install
npm startBranch i18n
git clone https://github.com/enten/angular-universal -b i18n my-project
cd my-project
npm install
npm run start:frTwo different dev servers are provided:
- The universal dev server which enable SSR (build
browserandservertargets) ; - The SPA dev server which is a webpack dev server (build
browsertarget only).
SPA dev server can be useless (or "broken"): it depends on your server implementation.
Run npm run dev (or npx ng-udkc) for an universal dev server. Navigate to http://localhost:4000/.
The app will automatically hot-reload on server and browser sides if you change any of the source files.
The server will automatically restart if a change occured in metafiles and metadirs defined in udk.container.js.
Run npm run dev:spa (or npx ng serve --hmr) for a SPA dev server Navigate to http://localhost:4200/.
The app will automatically reload if you change any of the browser source files.
Note: the universal dev server provide an SPA mode too if you navigate to the index.html: http://localhost:4000/index.html.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run npm run build to build the project. The build artifacts will be stored in the dist/app directory.
Run npm run build:prod for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.



