Skip to content

Commit 194d853

Browse files
committed
Implemented SSR structure on Angular app, serving rendered pages through Node
1 parent 76c6021 commit 194d853

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5373
-3759
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
dist
33

44
serviceAccountKey.json
5+
.vercel
56
.now
67
.env.build
78
.env

application/angular.json

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@
1717
"build": {
1818
"builder": "@angular-devkit/build-angular:browser",
1919
"options": {
20-
"outputPath": "dist/",
20+
"outputPath": "dist/browser",
2121
"index": "src/index.html",
2222
"main": "src/main.ts",
2323
"polyfills": "src/polyfills.ts",
2424
"tsConfig": "tsconfig.app.json",
2525
"aot": false,
2626
"assets": [
2727
"src/favicon.ico",
28-
"src/assets",
29-
"src/ssr"
28+
"src/assets"
3029
],
3130
"styles": [
3231
"src/styles.scss",
33-
"src/bs.css",
32+
"src/bs.css",
3433
"node_modules/quill/dist/quill.core.css",
3534
"node_modules/quill/dist/quill.snow.css",
3635
"node_modules/primeicons/primeicons.css",
@@ -39,7 +38,9 @@
3938
"node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.carousel.min.css",
4039
"node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.theme.default.min.css"
4140
],
42-
"scripts": ["node_modules/marked/lib/marked.js"]
41+
"scripts": [
42+
"node_modules/marked/lib/marked.js"
43+
]
4344
},
4445
"configurations": {
4546
"production": {
@@ -127,6 +128,29 @@
127128
"devServerTarget": "application:serve:production"
128129
}
129130
}
131+
},
132+
"server": {
133+
"builder": "@angular-devkit/build-angular:server",
134+
"options": {
135+
"outputPath": "dist/server",
136+
"main": "src/main.server.ts",
137+
"tsConfig": "tsconfig.server.json"
138+
},
139+
"configurations": {
140+
"production": {
141+
"fileReplacements": [
142+
{
143+
"replace": "src/environments/environment.ts",
144+
"with": "src/environments/environment.prod.ts"
145+
}
146+
],
147+
"sourceMap": false,
148+
"optimization": {
149+
"scripts": false,
150+
"styles": true
151+
}
152+
}
153+
}
130154
}
131155
}
132156
}},

0 commit comments

Comments
 (0)