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
360d7b3 added basic tree-shaking functionality. However, as implemented, modules that come away completely unused (and their dependencies) are still included in the module bundles.
detect which modules exclusively use ES6 exports
of those, detect which modules have ZERO used exports, and mark these for removal
for all other modules (which aren't removed, or which use non-ES6 exports), track its dependencies and mark these to keep
after all modules have been examined, check for any deep dependencies that aren't marked as keep, and remove them also
determine what to do for bundles whose entry points have been DCE'd
Edit: Took a simpler approach to this:
Detect all ES^ imports/exports for all modules.
Go through all modules and mark any imports as used.
For any unused exports, transform exports.foo = foo... into foo... so that it can be removed by a minifier.
This succeeds in removing unused exports from modules. However, this doesn't help determine which sub-dependencies are no longer needed. Need to take another pass at this to come up with a clever way to detect and remove the unused modules from the build.
The text was updated successfully, but these errors were encountered:
360d7b3 added basic tree-shaking functionality. However, as implemented, modules that come away completely unused (and their dependencies) are still included in the module bundles.
detect which modules exclusively use ES6 exportsfor all other modules (which aren't removed, or which use non-ES6 exports), track its dependencies and mark these to keepEdit: Took a simpler approach to this:
import
s/export
s for all modules.exports.foo = foo...
intofoo...
so that it can be removed by a minifier.This succeeds in removing unused exports from modules. However, this doesn't help determine which sub-dependencies are no longer needed. Need to take another pass at this to come up with a clever way to detect and remove the unused modules from the build.
The text was updated successfully, but these errors were encountered: