We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0dfa9b commit 6048ea1Copy full SHA for 6048ea1
src/core/utils.ts
@@ -1,6 +1,8 @@
1
import path from 'node:path'
2
3
-export function getModuleFormat(id: string): 'module' | 'commonjs' | undefined {
+export function getModuleFormat(
4
+ id: string,
5
+): 'module' | 'commonjs' | 'json' | undefined {
6
const ext = path.extname(id)
7
switch (ext) {
8
case '.mjs':
@@ -9,5 +11,7 @@ export function getModuleFormat(id: string): 'module' | 'commonjs' | undefined {
9
11
case '.cjs':
10
12
case '.cts':
13
return 'commonjs'
14
+ case '.json':
15
+ return 'json'
16
}
17
0 commit comments