From f0e47a666549fe30517b4c4cca81c3cb0e6c7d2e Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 24 Jul 2023 17:52:55 +0800 Subject: [PATCH] fix: set moduleResolution: Bundler in tsconfig.node.json It was `moduleResolution: "node"` in `@tsconfig/node18` v2, but later changed to `node16` in v18. This is a breaking change, and not suitable for our use cases. We use the Node.js tsconfig for configuration files, most of which expect either `moduleResolution: "node"` or `moduleResolution: "bundler"` (e.g. Vite, which has its own bundling logic for configuration file). So in the commit, I'm setting it to `moduleResolution: "bundler"`. I haven't seen any regressions myself, but if there are any, we can revert to `moduleResolution: "node"`. `node16` is obviously not compatible with many tools at the moment. --- template/tsconfig/base/tsconfig.node.json | 1 + 1 file changed, 1 insertion(+) diff --git a/template/tsconfig/base/tsconfig.node.json b/template/tsconfig/base/tsconfig.node.json index bb67dfcb..dee96bed 100644 --- a/template/tsconfig/base/tsconfig.node.json +++ b/template/tsconfig/base/tsconfig.node.json @@ -10,6 +10,7 @@ "compilerOptions": { "composite": true, "module": "ESNext", + "moduleResolution": "Bundler", "types": ["node"] } } -- 2.39.5