I am trying to dynamically load CSS in my Angular Project and I have followed the steps outlined in this tutorial:
However, I encountered a problem with my angular.json file:
"dyncss": {
...
"build": {
...
options: {
...
"styles": [
"src/styles.scss",
{
"input": "src/client-a-styles.scss",
"bundleName": "client-a",
"inject": false
},
{
"input": "src/client-b-styles.scss",
"bundleName": "client-b",
"inject": false
}
],
}
},
...
},
Adding the line "inject": false caused these errors to occur:
"Schema validation failed with the following errors: Data path ".styles[1]" should NOT have additional properties(inject). Data path ".styles[1]" should be string. Data path ".styles[1]" should match exactly one schema in oneOf"
If I remove the line "inject": false
, ng build works correctly but I need it for dynamic CSS loading...
p.s.: Running Angular version ^9.1.3
Any help on how to resolve this issue would be greatly appreciated! Thank you!