typescriptwebpackwebpack-loaderesbuild

Is it possible to mix the ts-loader and esbuild-loader?


Is there a way to mix the esbuild-loader and ts-loader? So that all .ts files are compiled with esbuild - except if there are decorators in the file then the files are compiled with tsc?


Solution

  • The author of this question ended up creating an esbuild plugin to do this: https://github.com/thomaschaaf/esbuild-plugin-tsc. See also this discussion thread for implementation considerations: https://github.com/evanw/esbuild/issues/915.