Skip to content

Commit 724f89e

Browse files
committed
Use module: node20 TypeScript compiler option
From the TypeScript 5.9 release candidate blog post[1]: > TypeScript provides several `node*` options for the `--module` and > `--moduleResolution` settings. Most recently, `--module nodenext` has > supported the ability to `require()` ECMAScript modules from CommonJS > modules, and correctly rejects import assertions (in favor of the > standards-bound import attributes[2]). > TypeScript 5.9 brings a stable option for these settings called > `node20`, intended to model the behavior of Node.js v20. This option > is unlikely to have new behaviors in the future, unlike > `--module nodenext` or `--moduleResolution nodenext`. Also unlike > `nodenext`, specifying `--module node20` will imply `--target es2023` > unless otherwise configured. `--module nodenext`, on the other hand, > implies the floating `--target esnext`. > For more information, take a look at the implementation here[3]. [1]: https://devblogs.microsoft.com/typescript/announcing-typescript-5-9-rc/#support-for---module-node20 [2]: https://github.com/tc39/proposal-import-attributes [3]: microsoft/TypeScript#61805
1 parent 518148e commit 724f89e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"extends": ["@epic-web/config/typescript"],
44
"compilerOptions": {
55
"lib": ["ES2024", "DOM", "DOM.Iterable"],
6-
"module": "node16",
6+
"module": "node20",
77
"moduleResolution": "node16",
88
"paths": {
99
"#app/*": ["./app/*"],

0 commit comments

Comments
 (0)