When a dynamic import is removed via tree-shaking it leaves an undefined behind in the Bundle object that is passed to the generateBundle plugin hook. This seems unintended and can cause bugs in plugins that use that data like @modular-css/rollup.
I made a gist. The README.md contains repro steps.
The Bundle object passed to generateBundle shouldn't have an undefined value inside of the dynamicImports array when a dynamic import is removed by tree-shaking.
The Bundle object passed to generateBundle has an undefined value inside of the dynamicImports array when a dynamic import is removed by tree-shaking.
Thanks for the nice repro! Fix at #2663.
Most helpful comment
Thanks for the nice repro! Fix at #2663.