Skip to content

Instantly share code, notes, and snippets.

View michael-azogu's full-sized avatar
🚿
thinkering

free_one_ michael-azogu

🚿
thinkering
View GitHub Profile
@michael-azogu
michael-azogu / _web-framework-render-fns.md
Created December 7, 2023 00:59 — forked from acutmore/_web-framework-render-fns.md
Comparing web framework render functions
@michael-azogu
michael-azogu / esm-package.md
Created October 23, 2023 16:47 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@michael-azogu
michael-azogu / rollup-optimization-research.md
Created October 17, 2023 12:11 — forked from bluwy/rollup-optimization-research.md
Rollup build optimization research

Rollup build optimization research

Rollup builds doesn't scale well in large apps. You need to increase Node's memory with --max-old-space-size=4096 to handle all the modules. This is one of Vite's highest-rated issue.

This file documents various findings and attempts to improve this issue.

How Rollup works

NOTE: I've only been reading Rollup's source code for a while, so some of these may not be accurate.