Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use provider.runtime to guess esbuild target #126

Closed
Mihailoff opened this issue May 7, 2021 · 3 comments · Fixed by #134
Closed

Use provider.runtime to guess esbuild target #126

Mihailoff opened this issue May 7, 2021 · 3 comments · Fixed by #134
Labels

Comments

@Mihailoff
Copy link

A nice to have feature request.

Docs say

The default JavaScript syntax target is set to ES2017

Plugin could use provider.runtime to change the target accordingly

In my case I ended up with

provider:
  runtime: nodejs14.x
  
custom:
  esbuild:
    target: es2020

And thank you for the super fast compiler!

@floydspace
Copy link
Owner

hi @Mihailoff, thanks for the request, it makes sense.
And all the kudos for the compiler goes to @evanw

@mattisdada
Copy link

Agreed this is a nice to have feature

One FYI, the target can actually be the Node version. Examples:

provider:
  runtime: nodejs14.x
  
custom:
  esbuild:
    target: node14
provider:
  runtime: nodejs12.x
  
custom:
  esbuild:
    target: node12

Source: https://esbuild.github.io/api/#target

That way you don't need to worry about which es version is compatible with which node version, esbuild already has that specific information to make sure the right features are used.

floydspace added a commit that referenced this issue May 29, 2021
floydspace added a commit that referenced this issue May 29, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 1.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants