shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.06k stars 51 forks source link

markdown-it-shiki-twoslash needs adjustments to publish as a module #55

Closed DanielRosenwasser closed 3 years ago

DanielRosenwasser commented 3 years ago

There's a few issues with the way the markdown-it package is published:

  1. It ships .js files with imports - the package.json needs to specify "type": "module" if it wants to do that.
  2. The package imports a non-module package (deasync). It probably needs to switch to require to bring it in. As a result, I'm not sure if #54 will even work.
frencojobs commented 3 years ago

You're right, it has the module field specified but the .esm.js wasn't generated. It used to be generated but since shifting to esbuild, it has not been properly worked on.

orta commented 3 years ago

Ah, this is unintentional - esbuild doesn't switch import to require which makes sense. I think we should probably just ship as a module and see how it goes.