How to configure Hammerjs in ng-package.json?
See original GitHub issueType of Issue
[ X] Bug Report
[ ] Feature Request
Description
I want to use hammerjs in my @ngu/carousel library and i can able run the project locally. then i created the library project using angular 6. then i try to build the library it throwing the error as Cannot find name 'Hammer'
.
Here is my ng-package.json
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/carousel",
"lib": {
"entryFile": "src/public_api.ts",
"externals": {
"@types/hammerjs": "Hammer",
"@types/hammerjs/index": "Hammer",
"hammerjs/hammer.js": "Hammer"
}
}
}
I don’t have an idea what to write in lib.external
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 3.0.3
@angular/*: 6.0.5
typescript: 2.7.2
rxjs: 6.2.1
node: 8.10.0
yarn: 1.7.0
Please include all version numbers that might be relevant, e.g. third-party libraries
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to add external js file in angular 6 library - Stack Overflow
Provide the reference of your external JS in your angular.json file of ... Just npm install hammerjs then edit your main.ts file and...
Read more >angular/angular-cli - Gitter
@Destreyf fixed it by adding 2 settings to my angular-cli.json! ... node_modules/hammerjs/hammer.min.js" ], to angular-cli.json which works just fine with ...
Read more >ng-package vs. package.json - DEV Community
If we hang around building libraries in Angular we're bound to run into how these two files work toge... Tagged with angular, typescript....
Read more >ng-packagr/ng-package.schema.json - UNPKG
22, "description": "Enable this to keep the 'scripts' section in package.json. Read the NPM Blog on 'Package install scripts vulnerability' ...
Read more >ngx-document-scanner - CodeSandbox
ngx-document-scanner. src. README.md. karma.conf.js. ng-package.json. package.json. tsconfig.lib.json. tsconfig.spec.json. tslint.json. ngx-ds-demo-app.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alan-agius4 Thanks for suggestion
Mentioning the hammerjs in projects lib
tsconfig.lib.json
file solves the issue"types": ["hammerjs"]
This will help someone with this issue
Replace that with ‘hammerjs’
Check here: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
On Thu, 02 Aug 2018 at 17:03, Sheik Althaf notifications@github.com wrote: