Skip to content

Commit

Permalink
feat(demo): add SSR support (#64)
Browse files Browse the repository at this point in the history
* feat(demo): add SSR support

* chore(comments): fix
  • Loading branch information
waterplea authored Dec 22, 2020
1 parent e35b7e3 commit aaf0786
Show file tree
Hide file tree
Showing 16 changed files with 1,431 additions and 282 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
${{ runner.OS }}-
- name: npm ci and build demo
run: |
npm ci
Expand All @@ -35,4 +35,4 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist/demo
FOLDER: dist/demo/browser
38 changes: 29 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/demo",
"outputPath": "dist/demo/browser",
"index": "projects/demo/src/index.html",
"main": "projects/demo/src/main.browser.ts",
"polyfills": "projects/demo/src/polyfills.ts",
Expand Down Expand Up @@ -601,25 +601,45 @@
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/server",
"main": "projects/demo/src/main.server.ts",
"outputPath": "dist/demo/server",
"main": "projects/demo/server.ts",
"tsConfig": "projects/demo/tsconfig.server.json",
"stylePreprocessorOptions": {
"includePaths": ["projects/core/styles"]
}
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "projects/demo/src/environments/environment.ts",
"with": "projects/demo/src/environments/environment.prod.ts"
}
],
"outputHashing": "media",
"sourceMap": false,
"optimization": true
}
}
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "demo:build",
"serverTarget": "demo:server"
},
"configurations": {
"production": {
"browserTarget": "demo:build:production",
"serverTarget": "demo:server:production"
}
}
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"browserTarget": "demo:build:production",
"serverTarget": "demo:server:production",
"routes": ["/"]
},
"configurations": {
"production": {}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
Expand Down
Loading

0 comments on commit aaf0786

Please sign in to comment.