web icon indicating copy to clipboard operation
web copied to clipboard

feat: move from CJS to ESM

Open 43081j opened this issue 7 months ago • 8 comments

this is an unreasonably large change which does a few things:

  • Moves all packages to type: "module"
  • Removes node-fetch (ran into problems in ESM-land)
  • Replaces all __dirname with an equivalent using import.meta
  • Replaces all require.resolve with import.meta.resolve
  • Update all imports to be ESM-compatible
  • Move all tsconfig to use nodenext resolution

Probably some other stuff too.

@koddsson if your branch is cleaner, and easier to review etc etc just let me know. im happy to throw this away, it was still a learning experience and i did go upstream to fix a few dependencies we have to make them work in nodenext.

ah yeah and it'll be outdated, probably a truckload of conflicts but i can update if we want it

43081j avatar Nov 21 '23 19:11 43081j