hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
24.12k stars 2.62k forks source link

Using HammerJS on Angular 10 project is giving warning to avoid it for optimization #1255

Open Shofol opened 4 years ago

Shofol commented 4 years ago
WARNING in E:\Projects\MISL\e-kyc\src\main.ts depends on hammerjs. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

So, I think we need some ECMA module for HammerJS to implement it as optimized in Angular. Does HammerJS has some module like this?

maranmaran commented 4 years ago

I agree and wish for ES modules version

In the meantime you can add hammer js in angular.json

"build": { .... "allowedCommonJsDependencies": [ "hammerjs", .... ] },

Shofol commented 4 years ago

@maranmaran, it will just stop the warning, right?

ghost commented 4 years ago

@Shofol yes

Walibu commented 3 years ago

I agree and wish for ES modules version

In the meantime you can add hammer js in angular.json

"build": { .... "allowedCommonJsDependencies": [ "hammerjs", .... ] },

Thank you, for me with Angular 11.2.x it must be set at build: .... { options: ... { "allowedCommonJsDependencies": [ "hammerjs", .... ] },` see: https://angular.io/guide/build#configuring-commonjs-dependencies