preactjs / wmr

👩‍🚀 The tiny all-in-one development tool for modern web apps.
https://wmr.dev/
MIT License
4.93k stars 109 forks source link

Switch CommonJS transform to cjs-module-lexer #109

Open developit opened 4 years ago

developit commented 4 years ago

Now that cjs-module-lexer is battle-tested (it powers CommonJS in Node as of 14.17), we should switch to it. This gives us a clean way to support CJS-->ESM transformations like we're already doing, but without the horrible regex-based implementation I cobbled together.

developit commented 3 years ago

Looks like cjs-module-lexer won't land my require() tracking fix: https://github.com/guybedford/cjs-module-lexer/pull/10/

I published the dist files (both JS and WASM) to a branch which we can vendor.