c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.33k stars 1.39k forks source link

C3 in Angular 10 and CommonJS dependencies #2809

Open pepearruda opened 3 years ago

pepearruda commented 3 years ago

When using C3 in Angular 10, we get the following warning:

WARNING in C:\working\my-c3-app\src\app\components\my-c3-gauge\my-c3-gauge.component.ts depends on 'c3'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Angular team is very clear about this and states: It is recommended that you avoid depending on CommonJS modules in your Angular applications. Depending on CommonJS modules can prevent bundlers and minifiers from optimizing your application, which results in larger bundle sizes. Instead, it is recommended that you use ECMAScript modules in your entire application.

Do you think that something can be done regarding this?

stephajn commented 3 years ago

While it is possible to suppress this warning according to this link: https://angular.io/guide/build#configuring-commonjs-dependencies it would be nicer if this issue could be addressed.