-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Set target to es2019 in default tsconfig.json #772
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested, looks like jsconfig doesn't need it, yeah.
Jsconfig doesn't need it because it's not used for bundling afaik. For tsconfig that's a different story though. Which problem was it? My fear is that transformations from ts to js might leave stuff in that is too new for anything besides Chrome. |
Vite can further transform the output though, can't it? There's even plugins to do ES5, if I remember correctly. TS -> JS is not the final output, I think? |
Honestly I don't know 😄 all I know for sure is that this setting will produce different output for the generated code inside Svelte script tags, because the preprocessors use the tsconfig. If it gets downleveld afterwards (js->older js) I don't know. |
We also need to update 7:17 error Parsing error: Unexpected token import
✖ 1 problem (1 error, 0 warnings) |
@lukeed might have something to say about this. I believe there was a reason we're targeting this version, and it may have to do with what's available in current lambda environments. |
Of the existing adapters, Vercel and Netlify has access to Node 14, and Begin has Node 12. Cloudflare Workers is running some version of v8.
- Linus Unnebäck from stackoverflow We're targeting 12.17+ due to ESM, so looks like we can instead do: {
"compilerOptions": {
"moduleResolution": "node",
"lib": ["es2020"],
"target": "es2019", That said I ironically cannot replicate |
I think es2019 is the latest value you can use while still working in most places. Something like |
e7c46c0
to
334a4f7
Compare
ok, i've bumped it to 2019 for now |
Should at least make it 2020. Someone on Discord ran into an issue with it being an older version
I hadn't set it in
jsconfig.json
because that file is pretty minimal and doesn't have any of the othertsconfig.json
contents. I'm not sure which settings go in both vs just one or the other