Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkuri/angular-rollup-starter
Angular2 & Rollup.js including AoT and Universal Prerendering
https://github.com/jkuri/angular-rollup-starter
angular aot prerender rollup tree-shake universal
Last synced: about 1 month ago
JSON representation
Angular2 & Rollup.js including AoT and Universal Prerendering
- Host: GitHub
- URL: https://github.com/jkuri/angular-rollup-starter
- Owner: jkuri
- License: mit
- Created: 2016-08-30T18:16:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T21:16:42.000Z (almost 8 years ago)
- Last Synced: 2024-09-28T09:07:20.572Z (3 months ago)
- Topics: angular, aot, prerender, rollup, tree-shake, universal
- Language: TypeScript
- Homepage:
- Size: 167 KB
- Stars: 32
- Watchers: 5
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular2 Rollup Seed
[![Build Status](https://travis-ci.org/jkuri/angular-rollup-starter.svg?branch=master)](https://travis-ci.org/jkuri/angular-rollup-starter)
[![Build status](https://ci.appveyor.com/api/projects/status/u6b3i8c8fnrh4dmb?svg=true)](https://ci.appveyor.com/project/jkuri/angular-rollup-starter)Angular2 starter seed based on Rollup.
Production builds including AoT steps.
Starter also comes with Universal support built-in.## Start
First, clone this repository.
```sh
git clone https://github.com/jkuri/angular-rollup-starter.git --depth 1
```Move into cloned directory and run
```sh
npm install
```## Usage
### Serve
```sh
npm start
```***Note*** Initial load takes some time so vendor files are generated.
Then it runs like a charm with cached builds which happens to be really fast.This serves your app with live-reload enabled.
### Production Build
Production builds automatically includes AoT (Ahead of Time) compilation steps.
```sh
npm run roll
```### Universal (Isomorphic) Production Build
```sh
npm run roll:prerender
```Routes stored in `config.json` as `universalRoutes` will be prerendered into `dist/` directory.
For example
```json
{
"externalPackages": { },
"styles": ["css/app.css"],
"universalRoutes": ["/", "/docs", "/docs/child"]
}
```will generate prerendered content in `dist/index.html` `dist/docs.html` and `dist/docs/child.html`.
To properly serve prerendered content use below `nginx` configuration.
```nginx
server {
listen 80;
server_name subdomain.example.com example.com;root /path/to/dist;
location / {
try_files $uri.html $uri $uri/ /index.html;
}
}
```### Licence
MIT