preactjs / preset-vite

Preset for using Preact with the vite bundler
https://npm.im/@preact/preset-vite
MIT License
260 stars 26 forks source link

fix: Ensure `stack-trace` works w/ CJS build #116

Closed rschristian closed 7 months ago

rschristian commented 7 months ago

Closes #115

stack-trace is shipped exclusively as ESM, so this switches to importing via dynamic import to fix CJS consumers.

marvinhagemeister commented 7 months ago

@rschristian FYI I made a stack trace parsing library a while back for Preact DevTools for the hook detection part. It should work too https://www.npmjs.com/package/errorstacks

rschristian commented 7 months ago

Oh nice, didn't know.

Any advantage over stack-trace (beyond maybe CJS support)?

marvinhagemeister commented 7 months ago

errorstacks works for other engines too, not just v8. But that probably doesn't matter here.