question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tree-shaking and destructured require optimizations

See original GitHub issue

It’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:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
stevenvachoncommented, Feb 20, 2017

Tree-shaking has existed longer than ES modules. The first I’d heard of it was jslim.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found