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
Removing empty imports of modules with moduleSideEffects: false #3057
Comments
The Suppressing those imports would indeed be a non-trivial feature request as the current implementation just works via changing the side-effect detection algorithm, but "being used" is always considered a side-effect. |
It could be argued, though, that for external imports the problem is a little simpler as we could run an additional check prior to finalization that filters out side-effect-free empty external imports. |
Wow that was a swift response. |
This will be fixed by #3369 |
Solved in rollup@2.0.0 |
How Do We Reproduce?
I'm not sure if this is a bug or feature request. See the example REPL
There is an import of external module
import { tool } from 'some-private-module';
in code (a shared chunk) shared across multiple entry points.
Now the entry points contain
import 'some-private-module';
In our codebase, we created a rollup plugin with a
resolveId
hook which resolves our'some-private-module'
asCorrect me if I'm wrong, but I don't see a good reason why
import 'some-private-module';
exists in the entry points.Expected Behavior
no
import 'some-private-module';
in entry pointsActual Behavior
import 'some-private-module';
in entry points existThe text was updated successfully, but these errors were encountered: