I am creating an angular library (version 6) which is based on angular material for which I need to include the hammer js library.
I know that in angular 6 we can add the external js library in the angular.json
under the project's configuration. But this does not work in case of above library. I tried to add the external library in the following way.
"my-library": {
"root": "projects/my-library",
"sourceRoot": "projects/my-library/src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/my-library/tsconfig.lib.json",
"project": "projects/my-library/ng-package.json",
"scripts": [
"../node_modules/hammerjs/hammer.min.js"
]
}
}
}
But I am getting this error.
Schema validation failed with the following errors: Data path "" should NOT have additional properties(scripts).
Please suggest what is the correct way to add external js file in the angular library.