Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree-shaken dynamic imports leave behind undefined in bundle #2659

Closed
tivac opened this issue Jan 16, 2019 · 1 comment · Fixed by #2663
Closed

Tree-shaken dynamic imports leave behind undefined in bundle #2659

tivac opened this issue Jan 16, 2019 · 1 comment · Fixed by #2663

Comments

@tivac
Copy link
Contributor

tivac commented Jan 16, 2019

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.

@lukastaegert
Copy link
Member

Thanks for the nice repro! Fix at #2663.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants