Re:Tiny Treeshaker: JavaScript tree shaking in 200 lines of ...
by onion2k on Tuesday June 29, 2021 @05:57AM
(#27673838)
Something that drives me bonkers about current tree shaking is that there’s no good way to see what got shaken.
On a super basic level you can just build with and without tree-shaking and diff the results. If you turn off transpiling and minification, and move your bundled NPM modules to their own separate file, you can see what parts of your own code got shaken out pretty easily.
I'm tempted to have a go at writing a tool to do that actually. It would be useful.
On a super basic level you can just build with and without tree-shaking and diff the results. If you turn off transpiling and minification, and move your bundled NPM modules to their own separate file, you can see what parts of your own code got shaken out pretty easily.
I'm tempted to have a go at writing a tool to do that actually. It would be useful.