Skip to content

Commit f9b18fa

Browse files
committed
test(angular): update ng19 for ssr
1 parent c6167c4 commit f9b18fa

File tree

2 files changed

+56
-36
lines changed

2 files changed

+56
-36
lines changed

packages/angular/test/apps/ng19/angular.json

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:browser",
1515
"options": {
16-
"outputPath": "dist/test-app",
16+
"outputPath": "dist/test-app/browser",
1717
"index": "src/index.html",
1818
"main": "src/main.ts",
19-
"polyfills": ["src/polyfills.ts"],
19+
"polyfills": "src/polyfills.ts",
2020
"tsConfig": "tsconfig.app.json",
21+
"buildOptimizer": true,
2122
"assets": [
2223
"src/favicon.ico",
2324
{
@@ -49,6 +50,8 @@
4950
"aot": true,
5051
"progress": false,
5152
"extractLicenses": true,
53+
"vendorChunk": false,
54+
"buildOptimizer": true,
5255
"budgets": [
5356
{
5457
"type": "initial",
@@ -62,32 +65,16 @@
6265
]
6366
},
6467
"development": {
68+
"buildOptimizer": false,
6569
"optimization": false,
70+
"vendorChunk": true,
6671
"extractLicenses": false,
6772
"sourceMap": true,
6873
"namedChunks": true
6974
}
7075
},
7176
"defaultConfiguration": "production"
7277
},
73-
"server": {
74-
"builder": "@angular-devkit/build-angular:server",
75-
"options": {
76-
"outputPath": "dist/test-app-server",
77-
"main": "src/main.server.ts",
78-
"tsConfig": "tsconfig.server.json"
79-
},
80-
"configurations": {
81-
"production": {
82-
"fileReplacements": [
83-
{
84-
"replace": "src/environments/environment.ts",
85-
"with": "src/environments/environment.prod.ts"
86-
}
87-
]
88-
}
89-
}
90-
},
9178
"serve": {
9279
"builder": "@angular-devkit/build-angular:dev-server",
9380
"options": {
@@ -103,14 +90,6 @@
10390
},
10491
"defaultConfiguration": "development"
10592
},
106-
"prerender": {
107-
"builder": "@nguniversal/builders:prerender",
108-
"options": {
109-
"buildTarget": "test-app:build:production",
110-
"serverTarget": "test-app:server:production",
111-
"routes": ["/"]
112-
}
113-
},
11493
"extract-i18n": {
11594
"builder": "@angular-devkit/build-angular:extract-i18n",
11695
"options": {
@@ -120,10 +99,49 @@
12099
"lint": {
121100
"builder": "@angular-eslint/builder:lint",
122101
"options": {
123-
"lintFilePatterns": [
124-
"src/**/*.ts",
125-
"src/**/*.html"
126-
]
102+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
103+
}
104+
},
105+
"server": {
106+
"builder": "@angular-devkit/build-angular:server",
107+
"options": {
108+
"outputPath": "dist/test-app/server",
109+
"main": "server.ts",
110+
"tsConfig": "tsconfig.server.json"
111+
},
112+
"configurations": {
113+
"production": {
114+
"outputHashing": "media",
115+
"fileReplacements": [
116+
{
117+
"replace": "src/environments/environment.ts",
118+
"with": "src/environments/environment.prod.ts"
119+
}
120+
],
121+
"sourceMap": false,
122+
"optimization": true
123+
}
124+
}
125+
},
126+
"serve-ssr": {
127+
"builder": "@angular-devkit/build-angular:ssr-dev-server",
128+
"options": {
129+
"browserTarget": "test-app:build",
130+
"serverTarget": "test-app:server"
131+
},
132+
"configurations": {
133+
"production": {
134+
"browserTarget": "test-app:build:production",
135+
"serverTarget": "test-app:server:production"
136+
}
137+
}
138+
},
139+
"prerender": {
140+
"builder": "@angular-devkit/build-angular:prerender",
141+
"options": {
142+
"browserTarget": "test-app:build:production",
143+
"serverTarget": "test-app:server:production",
144+
"routes": []
127145
}
128146
}
129147
}
@@ -133,7 +151,6 @@
133151
"schematicCollections": ["@angular-eslint/schematics"],
134152
"cache": {
135153
"enabled": false
136-
},
137-
"analytics": false
154+
}
138155
}
139156
}

packages/angular/test/apps/ng19/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
"sync": "sh scripts/sync.sh",
1010
"build": "ng build --configuration production --no-progress",
1111
"lint": "ng lint",
12+
"serve:ssr": "node dist/test-app/server/main.js",
13+
"build:ssr": "ng build --prod && ng run test-app:server:production",
14+
"dev:ssr": "ng run test-app:serve-ssr",
15+
"prerender": "ng run test-app:prerender",
1216
"cy.open": "cypress open",
1317
"cy.run": "cypress run",
1418
"test": "concurrently \"npm run start -- --configuration production\" \"wait-on http-get://localhost:4200 && npm run cy.run\" --kill-others --success first",
15-
"test.watch": "concurrently \"npm run start\" \"wait-on http-get://localhost:4200 && npm run cy.open\" --kill-others --success first",
16-
"serve:ssr:test-app": "node dist/test-app/server/server.mjs"
19+
"test.watch": "concurrently \"npm run start\" \"wait-on http-get://localhost:4200 && npm run cy.open\" --kill-others --success first"
1720
},
1821
"dependencies": {
1922
"@angular/animations": "^19.0.0",

0 commit comments

Comments
 (0)