Skip to content

Commit

Permalink
Set configurations for ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
max-lt committed Feb 19, 2024
1 parent 3a389e0 commit 9cc6daa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
28 changes: 23 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,30 @@
"sourceMap": true,
"outputPath": "dist/server",
"tsConfig": "tsconfig.ssr.json",
"main": "prerender.ts",
"optimization": {
"styles": false,
"scripts": true
"main": "prerender.ts"
},
"configurations": {
"development": {
"optimization": {
"styles": false,
"scripts": false
}
},
"production": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": {
"styles": false,
"scripts": true
}
}
}
},
"defaultConfiguration": "production"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"dev:prod": "ng serve --host 127.0.0.1 --port 4300 --configuration production",
"start": "ng serve",
"build": "ng build && ng run app:ssr && npm run prerender",
"build:ssr": "ng run app:ssr",
"build:ssr": "ng run app:ssr:production",
"build:app": "ng build --configuration production",
"build:app:dev": "ng build --configuration development",
"build:ssr:dev": "ng run app:ssr:development",
"prerender": "node dist/server/main.js",
"watch": "ng build --watch --configuration development",
"postinstall": "cd webpack && npm install",
Expand Down

0 comments on commit 9cc6daa

Please sign in to comment.