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
multiple inputs leading to full third party package imports #3109
Comments
Any import can have a side-effect, no matter if you actually import any bindings. Even if the bindings are removed, there could still be side-effects. Use the |
@lukastaegert shouldn't
I see the empty modules pop up |
Ah, sorry. This is a known "issue", in a way. So your file is not external but internal, so your REPL is not really accurate. This would be a more accurate example: What is happening here is that Rollup assumes that any file that is not completely removed does have side-effects of some kind and ignores the So yes, we hope to evetually change the logic such that when a file
then that import should be suppressed. |
This will be fixed by #3369 |
Solved in rollup@2.0.0 |
How Do We Reproduce?
Reproduction
Note how graphql goes from a tree-shakeable import to a "polyfill" one. The behavior in the actual repo is a bit more complicated since the import has to stay in the shared folder because it's used there. I can always supply more if needed, wanted to start out by having the most minimal reproduction.
I have linked the PR where the issue persists to this one, in that branch when you do:
yarn && yarn build
move to the
/dist/esm
folder and you'll see incore.js
andurql.js
that the full graphql and fast-json-stable-stringify are imported but only used in the shared index file.Note that we are using
And the graphql module itself has sideEffects: false
Expected Behavior
I would expect the
graphql
import to be cut away in both entries and to only live in the shared if used there.Actual Behavior
The imports stay and are now a huge bundle bloat.
The text was updated successfully, but these errors were encountered: