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
I am wondering if it has ever been considered to enable tree-shaking on dynamic imports. As a starter: If (and only if) every import of a module is easily statically analyzable, the same dead code elimination routines as they are used for static imports could be run.
If it is not easily analyzable, Parcel could always fall back to the current behavior. The resulting bundle sizes should remain same size or get smaller!.
With pure ESM this should be possible. We'd need to move the analysis of used imports to the bundling phase instead of the packaging phase though. It currently happens here. cc @mischnic I think you were running into something related today.
🙋 feature request
I am wondering if it has ever been considered to enable tree-shaking on dynamic imports. As a starter: If (and only if) every import of a module is easily statically analyzable, the same dead code elimination routines as they are used for static imports could be run.
If it is not easily analyzable, Parcel could always fall back to the current behavior. The resulting bundle sizes should remain same size or get smaller!.
Example
Example repo
The text was updated successfully, but these errors were encountered: