Skip to content

Commit 17bcd9b

Browse files
fix(vite): resolution where CJS output does not exist for import (#352)
* fix: upgrade from cjs node10 to node16 * changeset * Simplify module comment in Vite config * Change module option from Node16 to NodeNext * Update changeset --------- Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
1 parent fafb869 commit 17bcd9b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/empty-items-bet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/vite-config': patch
3+
---
4+
5+
fix: declaration resolution where CJS output does not exist for import

packages/vite-config/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const tanstackViteConfig = (options: Options): UserConfig => {
5757
exclude: options.exclude,
5858
tsconfigPath: options.tsconfigPath,
5959
compilerOptions: {
60-
module: 99, // ESNext
60+
module: 199, // NodeNext
6161
declarationMap: false,
6262
},
6363
beforeWriteFile: (filePath, content) => {
@@ -83,7 +83,7 @@ export const tanstackViteConfig = (options: Options): UserConfig => {
8383
exclude: options.exclude,
8484
tsconfigPath: options.tsconfigPath,
8585
compilerOptions: {
86-
module: 1, // CommonJS
86+
module: 199, // NodeNext
8787
declarationMap: false,
8888
},
8989
beforeWriteFile: (filePath, content) => {

0 commit comments

Comments
 (0)