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

esm output leaves behind dead namespace import #2895

Closed
Swatinem opened this issue Jun 5, 2019 · 3 comments · Fixed by #2900
Closed

esm output leaves behind dead namespace import #2895

Swatinem opened this issue Jun 5, 2019 · 3 comments · Fixed by #2900

Comments

@Swatinem
Copy link
Contributor

Swatinem commented Jun 5, 2019

I use import * as ts from "typescript"; inside my code.
When targeting esm output in rollup, all the imports are rewritten to specific identifiers, but one import * as ts is left behind, which is not used anywhere in the resulting bundle.
The commonjs output works correctly in this regard.

  • Rollup Version: 1.13.1
  • Operating System (or Browser): arch
  • Node Version: 11.15

How Do We Reproduce?

I wasn’t really able to reduce the testcase. I can’t reproduce it with simple examples in the REPL.
A whole repo repro is here:
https://github.com/Swatinem/rollup-plugin-dts/tree/v1.0.0

Expected Behavior

There should be no unused import * as ts left in the code.

Actual Behavior

One import * as ts in left behind, but the resulting ts identifier is not referenced anywhere in the code. All the other namespace imports are resolved to specific imports.

See the output here:
https://unpkg.com/rollup-plugin-dts@1.0.0/dist/rollup-plugin-dts.mjs

@lukastaegert
Copy link
Member

Thanks, there was really something we missed in our code, fix at #2900

@Swatinem
Copy link
Contributor Author

Swatinem commented Jun 5, 2019

Amazing how quickly you fix these things, thanks :-)

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

Successfully merging a pull request may close this issue.

2 participants