folke / esbuild-runner

⚡️ Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
https://www.npmjs.com/package/esbuild-runner
Apache License 2.0
712 stars 24 forks source link

feat: ✨ added support for esbuild plugins #46

Open bashmish opened 2 years ago

bashmish commented 2 years ago

Fixes #32

I'm using spawnAsync to run esbuild, so from the node's require point of view it's a sync call, while under the hood I call esbuild async methods build and transform which enables using esbuild plugins. This is battle tested in my company's huge monorepo, performance is still amazing.

I'll release my fork for now to unblock myself (https://www.npmjs.com/package/esbuild-runner-plugins), but I'll gladly work on improving this PR to get this into the mainstream. Looking forward to your feedback!

reckart commented 2 years ago

Would be great if the PR could be merged - meanwhile using the esbuild-runner-plugins works nicely and helped me running tests on svelte components using mocha and esbuild.