5 Matching Annotations
  1. Nov 2020
    1. 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.
    2. If tree-shaking still fails, it's because Rollup thinks that there are side-effects somewhere in your code.
    3. Avoid transpilers like Babel and Bublé (and if you're using TypeScript, target a modern version of JavaScript)
    4. Don't create instances of things on initial evaluation — instantiate lazily, when the functions you export are called