feat: add jiti/static export#430
Conversation
Static import of babel.cjs for Bun compiled binary support. Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
📝 WalkthroughWalkthroughA new static bootstrap module is added to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @pi0 , can we have a release for this please? jiti going from 2.5.1 to 2.6.1 (e.g. from nuxt/kit, that comes with nuxt/test-utils) when running (btw, I'm not using bun nor webpack, it's just default nuxt with vite and nuxi so not even sure if that new import will fix, since I can't change nuxt/kit way of import) |
|
@pi0 sorry for the ping, would like to have this released too please 🙏🏻 |
Adds a new
jiti/staticexport that statically importsbabel.cjsinstead of lazy-loading it viacreateRequire(import.meta.url).Closes #417
This solves two use cases:
babel.cjsgets bundled into the binarycreateRequire(import.meta.url)pattern breaks when bundlers rewriteimport.meta.urlto a hardcoded path. A static import lets bundlers resolve and includebabel.cjscorrectly.Usage:
Based on badlogic@800a4fc
Co-authored-by: Mario Zechner badlogicgames@gmail.com