Is Babel needed for Esbuild?

I’ve done some testing using TypeScript and one gotcha I found was that the CLI drags Babel in for the Esbuild config - this requires adding a .babelrc to add the Typescript preset.

However Esbuild seem perfectly capable without Babel - and I tried by commenting out the Babel plugin here: Lightning-CLI/esbuild.es6.config.js at master · rdkcentral/Lightning-CLI · GitHub

The result is that the Babel-free build is 4 times faster - I mean the whole point of Esbuild is to avoid using Babel in the first place.

So… is there a reason for including Babel?

If I remember correctly Babel was added to the Esbuild version to enable support for the class properties proposal. It does add some build time indeed, but esbuild is still rather fast with babel included, we have considered this and ultimately made the decision in favour of supporting class properties.

Thanks for the response @michiel.

However I couldn’t find anything with classes that didn’t just work without Babel.