Skip to content

Commit 6048ea1

Browse files
committed
fix: support json format
1 parent f0dfa9b commit 6048ea1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import path from 'node:path'
22

3-
export function getModuleFormat(id: string): 'module' | 'commonjs' | undefined {
3+
export function getModuleFormat(
4+
id: string,
5+
): 'module' | 'commonjs' | 'json' | undefined {
46
const ext = path.extname(id)
57
switch (ext) {
68
case '.mjs':
@@ -9,5 +11,7 @@ export function getModuleFormat(id: string): 'module' | 'commonjs' | undefined {
911
case '.cjs':
1012
case '.cts':
1113
return 'commonjs'
14+
case '.json':
15+
return 'json'
1216
}
1317
}

0 commit comments

Comments
 (0)