Skip to content

Commit 4845821

Browse files
committed
chore: improve tsResolve comments
1 parent a9ad8b4 commit 4845821

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: src/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ function resolveExtension(id: string) {
189189
return
190190
}
191191

192-
if (id.endsWith('.mjs')) {
192+
if (id.endsWith('.cjs')) {
193193
return {
194194
path: idWithoutJsExt,
195-
extensions: ['.mts', '.d.mts'],
195+
extensions: ['.cts', '.d.cts'],
196196
}
197197
}
198198

199-
if (id.endsWith('.cjs')) {
199+
if (id.endsWith('.mjs')) {
200200
return {
201201
path: idWithoutJsExt,
202-
extensions: ['.cts', '.d.cts'],
202+
extensions: ['.mts', '.d.mts'],
203203
}
204204
}
205205

@@ -210,7 +210,7 @@ function resolveExtension(id: string) {
210210

211211
/**
212212
* Like `sync` from `resolve` package, but considers that the module id
213-
* could have a .js or .jsx extension.
213+
* could have a .cjs, .mjs, .js or .jsx extension.
214214
*/
215215
function tsResolve(
216216
source: string,

0 commit comments

Comments
 (0)