Rollup: Tree-shaken dynamic imports leave behind `undefined` in bundle

Created on 16 Jan 2019  路  1Comment  路  Source: rollup/rollup

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.

  • Rollup Version: 1.1.0
  • Operating System (or Browser): Windows 10
  • Node Version: 10.12.0

How Do We Reproduce?

I made a gist. The README.md contains repro steps.

Expected Behavior

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.

Actual Behavior

The Bundle object passed to generateBundle has an undefined value inside of the dynamicImports array when a dynamic import is removed by tree-shaking.

t鹿 馃悶 bug

Most helpful comment

Thanks for the nice repro! Fix at #2663.

>All comments

Thanks for the nice repro! Fix at #2663.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

otakustay picture otakustay  路  3Comments

jeffsaremi picture jeffsaremi  路  3Comments

torch2424 picture torch2424  路  3Comments

adammockor picture adammockor  路  3Comments

jodarove picture jodarove  路  3Comments