vis-network
vis-network copied to clipboard
Angular: CommonJS or AMD dependencies can cause optimization bailouts
When using Angular, importing from vis-network
import {
Network,
Node,
Data,
Options,
} from 'vis-network'
and it caused this warning:
Warning: ... depends on 'vis-network'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Even when it's imported from esnext
import { Network } from 'vis-network/esnext'
still we get the following
node_modules\vis-network\esnext\esm\vis-network.js depends on 'component-emitter'.
CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
I can confirm that it is still an issue with version 9.1.9 of vis-network. It makes the application bundle larger by almost one megabyte for Angular app with a simple demo of vis network usage, which is a lot.