Created
October 2, 2022 17:55
-
-
Save ayyash/32b17ddcf59bf662984bc7ec2d29cbba to your computer and use it in GitHub Desktop.
Minimun required specs for Angular Prerender
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"newProjectRoot": "projects", | |
"projects": { | |
"cr": { | |
// ... | |
"prefix": "cr", | |
"architect": { | |
"build": { | |
"builder": "@angular-devkit/build-angular:browser", | |
"options": { | |
// ... the usual options for browser | |
}, | |
"configurations": { | |
"production": { | |
"outputPath": "./host/client/", | |
"index": "src/index.html", | |
// ... other | |
} | |
} | |
}, | |
"server": { | |
"builder": "@angular-devkit/build-angular:server", | |
"options": { | |
"outputPath": "./host/server/", | |
"main": "server.ts", | |
"tsConfig": "tsconfig.server.json", | |
// ... | |
} | |
}, | |
"configurations": { | |
"production": { | |
"fileReplacements": [ | |
{ | |
"replace": "src/environments/environment.ts", | |
"with": "src/environments/environment.prod.ts" | |
} | |
], | |
"optimization": false, | |
// ... | |
} | |
}, | |
"prerender": { | |
"builder": "@nguniversal/builders:prerender", | |
"options": { | |
"browserTarget": "cr:build:production", | |
"serverTarget": "cr:server:production", | |
"guessRoutes": false, // guessing outputs all routes | |
"routes": [ | |
"/projects/create", | |
"/projects/1", | |
"/example", | |
"/" // this will generate index.original.html in the client folder | |
] | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment