Tree-shaking and destructured require optimizations
See original GitHub issueIt’d be great if:
const {normalize:normalizePath} = require('path');
…and perhaps also:
var normalizePath = require('path').normalize;
…would behave like:
import {normalize as normalizePath} from 'path';
…in that it would only bundle normalize()
and anything required for it to run.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Reduce JavaScript payloads with tree shaking - web.dev
Knowing where to begin optimizing your application's JavaScript can be ... This should be all that's needed for tree shaking to work in...
Read more >Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code ... (more known as tree shaking) optimizations are two different...
Read more >Tree-Shaking: A Reference Guide - Smashing Magazine
“Tree-shaking” is a must-have performance optimization when bundling JavaScript. In this article, we dive deeper on how exactly it works and ...
Read more >Improving Site Performance With Webpack Tree Shaking
To be able to take advantage of tree shaking, we had to meet the following criteria: Use ES6 module syntax (i.e., import and...
Read more >Optimization - TSDX
babel-plugin-annotate-pure-calls + babel-plugin-dev-expressions work together to fully eliminate dead code (aka treeshake) development checks from your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://www.npmjs.com/package/common-shakeify does this, through https://www.npmjs.com/package/common-shake!
Tree-shaking has existed longer than ES modules. The first I’d heard of it was jslim.