Skip to content

Commit 6bef3dc

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): allow json files in fileReplacement
JSON files a can also be valid fileReplacement when using the `resolveJsonModule` TypeScript feature. This causes JSON files to be resolved as JS modules and hence be part of the TypeScript program. Closes #19378 (cherry picked from commit 715a7a5)
1 parent f847db8 commit 6bef3dc

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

packages/angular/cli/lib/config/schema.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,11 +1044,11 @@
10441044
"properties": {
10451045
"src": {
10461046
"type": "string",
1047-
"pattern": "\\.([cm]?j|t)sx?$"
1047+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
10481048
},
10491049
"replaceWith": {
10501050
"type": "string",
1051-
"pattern": "\\.([cm]?j|t)sx?$"
1051+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
10521052
}
10531053
},
10541054
"additionalProperties": false,
@@ -1062,11 +1062,11 @@
10621062
"properties": {
10631063
"replace": {
10641064
"type": "string",
1065-
"pattern": "\\.([cm]?j|t)sx?$"
1065+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
10661066
},
10671067
"with": {
10681068
"type": "string",
1069-
"pattern": "\\.([cm]?j|t)sx?$"
1069+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
10701070
}
10711071
},
10721072
"additionalProperties": false,
@@ -1936,11 +1936,11 @@
19361936
"properties": {
19371937
"src": {
19381938
"type": "string",
1939-
"pattern": "\\.([cm]?j|t)sx?$"
1939+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
19401940
},
19411941
"replaceWith": {
19421942
"type": "string",
1943-
"pattern": "\\.([cm]?j|t)sx?$"
1943+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
19441944
}
19451945
},
19461946
"additionalProperties": false,
@@ -1954,11 +1954,11 @@
19541954
"properties": {
19551955
"replace": {
19561956
"type": "string",
1957-
"pattern": "\\.([cm]?j|t)sx?$"
1957+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
19581958
},
19591959
"with": {
19601960
"type": "string",
1961-
"pattern": "\\.([cm]?j|t)sx?$"
1961+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
19621962
}
19631963
},
19641964
"additionalProperties": false,

packages/angular_devkit/build_angular/src/browser/schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@
429429
"properties": {
430430
"src": {
431431
"type": "string",
432-
"pattern": "\\.([cm]?j|t)sx?$"
432+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
433433
},
434434
"replaceWith": {
435435
"type": "string",
436-
"pattern": "\\.([cm]?j|t)sx?$"
436+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
437437
}
438438
},
439439
"additionalProperties": false,
@@ -447,11 +447,11 @@
447447
"properties": {
448448
"replace": {
449449
"type": "string",
450-
"pattern": "\\.([cm]?j|t)sx?$"
450+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
451451
},
452452
"with": {
453453
"type": "string",
454-
"pattern": "\\.([cm]?j|t)sx?$"
454+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
455455
}
456456
},
457457
"additionalProperties": false,

packages/angular_devkit/build_angular/src/server/schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@
260260
"properties": {
261261
"src": {
262262
"type": "string",
263-
"pattern": "\\.([cm]?j|t)sx?$"
263+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
264264
},
265265
"replaceWith": {
266266
"type": "string",
267-
"pattern": "\\.([cm]?j|t)sx?$"
267+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
268268
}
269269
},
270270
"additionalProperties": false,
@@ -278,11 +278,11 @@
278278
"properties": {
279279
"replace": {
280280
"type": "string",
281-
"pattern": "\\.([cm]?j|t)sx?$"
281+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
282282
},
283283
"with": {
284284
"type": "string",
285-
"pattern": "\\.([cm]?j|t)sx?$"
285+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
286286
}
287287
},
288288
"additionalProperties": false,

0 commit comments

Comments
 (0)