-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options-resolve-module.mts
91 lines (81 loc) · 1.91 KB
/
options-resolve-module.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
* @file Interfaces - ResolveModuleOptions
* @module mlly/interfaces/ResolveModuleOptions
*/
import type {
Aliases,
ChangeExtFn,
FileSystem,
MainField,
ModuleId
} from '@flex-development/mlly'
import type { Condition } from '@flex-development/pkg-types'
/**
* Module resolution options.
*/
interface ResolveModuleOptions {
/**
* Path mappings.
*
* > 👉 **Note**: Paths should be relative to {@linkcode cwd}.
*
* @see {@linkcode Aliases}
*/
aliases?: Aliases | null | undefined
/**
* List of export/import conditions.
*
* > 👉 **Note**: Should be sorted by priority.
*
* @see {@linkcode Condition}
* @see https://nodejs.org/api/packages.html#conditional-exports
*
* @default defaultConditions
*/
conditions?: Condition[] | Set<Condition> | null | undefined
/**
* URL of directory to resolve path aliases from.
*
* @see {@linkcode ModuleId}
*
* @default cwd()
*/
cwd?: ModuleId | null | undefined
/**
* Replacement file extension or function that returns a file extension.
*
* An empty string (`''`) or `null` will remove a file extension.
*
* @see {@linkcode ChangeExtFn}
*/
ext?: ChangeExtFn | string | null | undefined
/**
* Module extensions to probe for.
*
* > 👉 **Note**: Should be sorted by priority.
*
* @default defaultExtensions
*/
extensions?: Set<string> | string[] | null | undefined
/**
* File system API.
*
* @see {@linkcode FileSystem}
*/
fs?: FileSystem | null | undefined
/**
* List of legacy `main` fields.
*
* > 👉 **Note**: Should be sorted by priority.
*
* @see {@linkcode MainField}
*
* @default defaultMainFields
*/
mainFields?: MainField[] | Set<MainField> | null | undefined
/**
* Keep symlinks instead of resolving them.
*/
preserveSymlinks?: boolean | null | undefined
}
export type { ResolveModuleOptions as default }