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

create-svelte: update tsconfig to allow es2020 module and lib #817

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

GrygrFlzr
Copy link
Member

Why module es2020?
Currently, using dynamic imports with TypeScript results in:

Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'.ts(1323)

Dynamic imports have been available unflagged since Node v12.17.

Why lib es2020?
Node v12.10+ has support for String.prototype.matchAll, BigInt, Promise.allSettled, and globalThis.


Since we target Node v12.17+ for ESM support, this allows TS users to use the new builtins and dynamic imports without forcing target es2020 which lets the nullish coalescing operator ?? and optional chaining operator ?. pass through and are undesirable.

jsconfig does not need these changes.

@GrygrFlzr GrygrFlzr requested a review from dummdidumm April 1, 2021 08:39
@dummdidumm dummdidumm merged commit 570f90c into master Apr 1, 2021
@dummdidumm dummdidumm deleted the es2020-module-lib branch April 1, 2021 09:27
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

Successfully merging this pull request may close these issues.

2 participants