5 Matching Annotations
- Nov 2020
-
github.com github.com
-
With the advent of JavaScript modules (import and export), it's possible to build libraries that are tree-shakeable. This means that a user of your library can import just the bits they need, without burdening their users with all the code you're not using.
-
If tree-shaking still fails, it's because Rollup thinks that there are side-effects somewhere in your code.
-
Avoid transpilers like Babel and Bublé (and if you're using TypeScript, target a modern version of JavaScript)
-
-
Don't create instances of things on initial evaluation — instantiate lazily, when the functions you export are called
-