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

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).


Solution 1:[1]

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.

          },

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michael Koutridis