Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
595 views
in Technique[技术] by (71.8m points)

configuration - File replacements in angular.json causing errors in Angular 11 library

I created an Angular 11 library. Inside the angular.json file for the library workspace, I am trying to add fileReplacements similar to how it is done for a normal angular app. The code I added inside configurations section in angular.json is shown below.

"configurations": {
     "production": {
        "tsConfig": "projects/cw-component-lib/tsconfig.lib.prod.json",
        "fileReplacements": [
          {
                "replace": "projects/cw-component-lib/src/lib/scss/theme.scss",
                "with": "projects/cw-component-lib/src/lib/themes/themenew.scss"
          }
        ]
     }
 }

The cw-component-lib is the project which is insdie the projects folder of the library. Now when I try to run the build command ng build cw-component-lib --prod I get the below error

Schema validation failed with the following errors:
Data path "" should NOT have additional properties(fileReplacements).

I don't know what exactly is causing the issue. Please help me out with this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...