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

should follow tsconfig compilerOptions target when didn't pass target #277

Closed
bluelovers opened this issue Jul 20, 2020 · 2 comments
Closed

Comments

@bluelovers
Copy link

let b;
export let a = b ??= true;
{
  "compilerOptions": {
    "target": "ES2019"
  }
}

this 2 should get same output

esbuild index.ts --tsconfig=./tsconfig.json --target=es2019
esbuild index.ts --tsconfig=./tsconfig.json

expected output

let b;
export let a = b !== null && b !== void 0 ? b : b = true;
@evanw
Copy link
Owner

evanw commented Jul 29, 2020

I understand why this would be useful. However, different directories can take their settings from different tsconfig.json files with esbuild. In my opinion it would be confusing and error-prone for the language target (which really only makes sense as a global setting) to vary per-directory, especially by default. So I think the current esbuild behavior of having to specify a global language target is actually less error-prone and more correct.

@DylanVann
Copy link

The recently merged behavior can be an issue when there are tsconfig.json files in node_modules.

e.g.

I'm bundling some code that uses subscriptions-transport-ws which contains a tsconfig.json file that specifies "target": "es5". This results in errors like error: Transforming const to the configured target environment ("es5") is not supported yet.

Ideally I would like to totally ignore tsconfig.json files, and bundle/compile everything to the target I specify.

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

No branches or pull requests

3 participants