/
index.ts
68 lines (53 loc) · 1.47 KB
/
index.ts
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
import '../../../../../../types/importMeta'
export interface ModuleType {
name: string
}
export const basic = import.meta.glob<ModuleType>('./modules/*.ts')
export const basicEager = import.meta.glob<ModuleType>('./modules/*.ts', {
eager: true
})
export const ignore = import.meta.glob(['./modules/*.ts', '!**/index.ts'])
export const namedEager = import.meta.glob<string>('./modules/*.ts', {
eager: true,
import: 'name'
})
export const namedDefault = import.meta.glob<string>('./modules/*.ts', {
import: 'default'
})
export const eagerAs = import.meta.glob<ModuleType>(
['./modules/*.ts', '!**/index.ts'],
{ eager: true, as: 'raw' }
)
export const rawImportModule = import.meta.glob(
['./modules/*.ts', '!**/index.ts'],
{ as: 'raw', import: '*' }
)
export const excludeSelf = import.meta.glob(
'./*.ts'
// for test: annotation contain ")"
/*
* for test: annotation contain ")"
* */
)
export const customQueryString = import.meta.glob('./*.ts', { query: 'custom' })
export const customQueryObject = import.meta.glob('./*.ts', {
query: {
foo: 'bar',
raw: true
}
})
export const parent = import.meta.glob('../../playground/src/*.ts', {
as: 'url'
})
export const rootMixedRelative = import.meta.glob(
['/*.ts', '../fixture-b/*.ts'],
{ as: 'url' }
)
export const cleverCwd1 = import.meta.glob(
'./node_modules/framework/**/*.page.js'
)
export const cleverCwd2 = import.meta.glob([
'./modules/*.ts',
'../fixture-b/*.ts',
'!**/index.ts'
])