c3js/c3

C3 in Angular 10 and CommonJS dependencies

pepearruda opened this issue · 1 comments

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?

  • C3 version: 0.7.18
  • D3 version: 5.8.0
  • Browser: Google Chrome Version 84.0.4147.105 (Official Build) (64-bit)
  • OS: Windows 10

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.