You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, the previous version in which this bug was not present was: 10.2.4
Description
Previously you could replace .html and .css for components during build. After updating to Angular 11.2.3 it is no longer possible to run ng serve or ng build without it failing because of schema validation.
Example is done in angular 10.2.4 ng serve and ng build will work and replace files specified in angular.json.
Run ng update @angular/core @angular/cli
ng serve and ng build will no longer work and throw an error..
🔥 Exception or Error
Schema validation failed with the following errors:
Data path ".fileReplacements[0]" should NOT have additional properties(replace).
Data path ".fileReplacements[0].replace" should match pattern "\.(([cm]?j\|t)sx?\|json)$".
Data path ".fileReplacements[0]" should match exactly one schema in oneOf.
The change was done in commit 424af28 to prevent replacing files not part of the bundle.
#19390 was closed because of inactivity a month ago. I see prevously threads mentions that fileReplacements are not meant for assets, but i believe style and templates for the components are not assets but part of the bundle and should be supported?
The text was updated successfully, but these errors were encountered:
I am sorry that you are facing this issue, but this is the expected behaviour.
fileReplacements is meant to work on source files which are part of the TypeScript program. While in previous version It did work one some other files this was a bug which did cause several issues including increasing build times.
In version 11, we did add a validation so enforce users to use fileReplacements to stay on the supported path and only replace file types which are part of the TypeScript program.
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: 10.2.4Description
Previously you could replace .html and .css for components during build. After updating to Angular 11.2.3 it is no longer possible to run ng serve or ng build without it failing because of schema validation.
🔬 Minimal Reproduction
Minimal example is available in repository https://github.com/Dalesjo/file-replacement-issue
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
The change was done in commit 424af28 to prevent replacing files not part of the bundle.
#19390 was closed because of inactivity a month ago. I see prevously threads mentions that fileReplacements are not meant for assets, but i believe style and templates for the components are not assets but part of the bundle and should be supported?
The text was updated successfully, but these errors were encountered: