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

Modules resolved by plugins are never tree-shakeable #1314

Closed
chriscasola opened this issue May 25, 2021 · 1 comment
Closed

Modules resolved by plugins are never tree-shakeable #1314

chriscasola opened this issue May 25, 2021 · 1 comment

Comments

@chriscasola
Copy link
Contributor

See PR #1313

Pasting the description for reference:

@agaynor and I have been working on a non-public esbuild plugin that resolves vue modules. We're running into an issue where any module that matches the onResolve hook for a plugin becomes exempt from all tree shaking, even if it is in a package with sideEffects: false.

The unit test in this PR named TestPackageJsonSideEffectsFalsePluginResolver demonstrates the issue. It is failing because the cmp1.js file is not being tree-shaken.

From what we can tell, only the built-in resolver can mark modules as not having side effects which happens here.

Is there any way to make it possible for plugins to indicate in the resolve result that the same "has side effects" logic should be applied to the resolved path?

@evanw
Copy link
Owner

evanw commented May 26, 2021

This hasn't been implemented yet. Closing this issue as a duplicate of #1009.

@evanw evanw closed this as completed May 26, 2021
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

No branches or pull requests

2 participants