You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can type npx esbuild --bundle --tsconfig=nonsense src/mod.ts and it just seems to ignore the nonsense.
If I type npx esbuild --bundle --tsconfig=./tsconfig.json src/mod.ts which should be correct, it ignores the target property, or it is just not reading it at all.
If I corrupt my tsconfig.json and type npx esbuild --bundle src/mod.ts it works, so it is not reading tsconfig.json by default?
es vs ES
In tsconfig.json the target string starts with uppercase ES, for example:
Some settings are taken from tsconfig.json but esbuild is not a perfect replica of tsc and isn't intended to be.
The target property in tsconfig.json is actually completely ignored by esbuild. Instead, esbuild has its own target property that behaves differently. This has been requested in the past too: #277. I don't think it's a good idea to respect target in tsconfig.json because esbuild supports multiple tsconfig.json files per build but the language target only makes sense as a single value that is a constant for the entire build.
The values for esbuild's target are different than the values for the TypeScript compiler. For example, you can pass node10 or firefox50 to be compatible with those specific versions of those JavaScript environments. So the fact that they are lowercase is an independent decision that's not related to the TypeScript compiler (all of esbuild's flag values are lowercase).
It looks like I'm missing an error for if the file passed to --tsconfig doesn't exist. I'll make that an error.
tsconfig not read
I can type
npx esbuild --bundle --tsconfig=nonsense src/mod.ts
and it just seems to ignore thenonsense
.If I type
npx esbuild --bundle --tsconfig=./tsconfig.json src/mod.ts
which should be correct, it ignores thetarget
property, or it is just not reading it at all.If I corrupt my
tsconfig.json
and typenpx esbuild --bundle src/mod.ts
it works, so it is not readingtsconfig.json
by default?es vs ES
In
tsconfig.json
thetarget
string starts with uppercase ES, for example:The hover over in VS Code says:
Specify ECMAScript target version: 'ES3', 'ES5', 'ES6'/'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ESNext'
but
esbuild
wants lowercasees2017
etc? Is there a reason for this? When using https://github.com/egoist/rollup-plugin-esbuild it will only accept lowercase version in thetsconfig.json
I am running Linux.
The text was updated successfully, but these errors were encountered: