Esbuild: feature request: arrow function transformation

Created on 18 Jun 2020  路  6Comments  路  Source: evanw/esbuild

it's the only thing preventing me from switching from babel really

Most helpful comment

The minimum language target for esbuild is set at ES6, which supports arrow functions. It's not possible to set the language target to ES5. I'm currently not intending for esbuild to be able to target below ES6, at least not while there's still a lot of remaining work to do for transforming syntax for ES6 and up.

You might want to look at other tools for this. I've heard that swc is trying to be a faster implementation of Babel, so it might be a good replacement for you.

All 6 comments

The minimum language target for esbuild is set at ES6, which supports arrow functions. It's not possible to set the language target to ES5. I'm currently not intending for esbuild to be able to target below ES6, at least not while there's still a lot of remaining work to do for transforming syntax for ES6 and up.

You might want to look at other tools for this. I've heard that swc is trying to be a faster implementation of Babel, so it might be a good replacement for you.

Hm, could be worth doing a survey:

  • How many people aren't using esbuild because it doesn't convert X feature of ES2019 down to ES6?
  • How many people aren't using esbuild because it doesn't convert X feature of ES6 to ES5?

Personally I most need async/await lowering, but generally I would fall in the latter camp; I care more about supporting older browsers than things like async generators or bigints.

Aside from speed, what's most exciting about esbuild is its potential to centralize the entire build process into a single tool. I think ditching Babel is less about the speed increase and more about the toolchain simplicity.

I'll just use esbuild for projects that don't need to support ie then, thanks ^^

Personally I most need async/await lowering

FYI I just implemented this in version 0.5.8 (see also #137).

Edit: well, only down to ES6.

I'm going to close this in favor of #297 which is more general.

馃く

(take note, @MathGeniusJodie)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

evanplaice picture evanplaice  路  3Comments

sarsamurmu picture sarsamurmu  路  3Comments

iamakulov picture iamakulov  路  4Comments

frandiox picture frandiox  路  3Comments

wcastand picture wcastand  路  4Comments