5
5
*/
6
6
7
7
import * as mlly from '@flex-development/mlly'
8
- import pathe from '@flex-development/pathe'
8
+ import * as pathe from '@flex-development/pathe'
9
+ import * as tutils from '@flex-development/tutils'
9
10
import * as esbuild from 'esbuild'
10
11
import { fileURLToPath , pathToFileURL } from 'node:url'
11
12
import tsconfig from './tsconfig.json' assert { type : 'json ' }
@@ -17,7 +18,8 @@ mlly.EXTENSION_FORMAT_MAP.set('', mlly.Format.COMMONJS)
17
18
/**
18
19
* URL of current working directory.
19
20
*
20
- * @const {URL} cwd
21
+ * @type {import('node:url').URL }
22
+ * @const cwd
21
23
*/
22
24
const cwd = pathToFileURL ( tsconfig . compilerOptions . baseUrl )
23
25
@@ -43,14 +45,16 @@ export const load = async (url, context) => {
43
45
/**
44
46
* File extension of {@linkcode url}.
45
47
*
46
- * @const {ReturnType<typeof pathe['extname']>} ext
48
+ * @type {pathe.Ext | tutils.EmptyString }
49
+ * @const ext
47
50
*/
48
51
const ext = pathe . extname ( url )
49
52
50
53
/**
51
54
* Source code.
52
55
*
53
- * @var {Uint8Array | string | undefined} source
56
+ * @type {Uint8Array | string | undefined }
57
+ * @var source
54
58
*/
55
59
let source = await mlly . getSource ( url , { format : context . format } )
56
60
@@ -119,7 +123,8 @@ export const resolve = async (specifier, context) => {
119
123
/**
120
124
* Resolved module URL.
121
125
*
122
- * @const {URL} url
126
+ * @type {import('node:url').URL }
127
+ * @const url
123
128
*/
124
129
const url = await mlly . resolveModule ( specifier , { conditions, parent } )
125
130
0 commit comments