egoist / esbuild-register

Transpile JSX, TypeScript and esnext features on the fly with esbuild
MIT License
984 stars 52 forks source link

Bug: can’t use decorators if esbuild version is >= 0.18.0 #92

Open alex-kinokon opened 1 year ago

alex-kinokon commented 1 year ago

Same issue as https://github.com/egoist/rollup-plugin-esbuild/issues/365, register should pass experimentalDecorators to esbuild. Copied from the issue:

Starting from v0.18.0 esbuild throws an error if TypeScript decorators are used in the project.

ERROR: Experimental decorators are not currently enabled This is because esbuild now checks for experimentalDecorators: true in tsconfig (https://github.com/evanw/esbuild/commit/6f2c029071d4d791adb5ac77cead34284bc446b8).

lynxSven commented 6 months ago

Is there any update? Trying to use mocha with esbuild. My Tests fail, because I see no way to hand the experimentalDecorators:true to my tests.

the tsconfig.json includes the value experimentalDecorators:true, but the esbuild-register doesn't take this into account.

IcaroG commented 2 months ago

Would be great to have this so we don't need to fork the lib just to upgrade esbuild.

IcaroG commented 2 months ago

Would you accept a PR for this? @egoist