Data path "" should NOT have additional properties (assets). - Angular library

Viewed 432

I'm moving an app to a library and I need to export its assets, but I can't use the "assets" parameter at the "ng-package.json".

ng-package.json

{
  "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "[DEST_FOLDER]",
  "lib": {
    "entryFile": "src/public-api.ts",
    "styleIncludePaths": [
      "src/styles",
      "../../../node_modules"
    ]
  },
  "assets": [ "src/styles" ]
}

And when compiling the application I get the error message:

ERROR: Configuration doesn't match the required schema.
Data path "" should NOT have additional properties (assets).
Configuration doesn't match the required schema.
Data path "" should NOT have additional properties (assets).
Error: Configuration doesn't match the required schema.
Data path "" should NOT have additional properties (assets).
1 Answers

try to remove "assets" property from your angular.json config.

example:

"architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:ng-packagr",
          "options": {
            ...
            "assets": [...] => remove this from the config.

          },
Related