You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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?
The text was updated successfully, but these errors were encountered:
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 thecmp1.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?
The text was updated successfully, but these errors were encountered: