马宇豪
2024-07-16 f591c27b57e2418c9495bc02ae8cfff84d35bc18
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultLoadersSync = exports.defaultLoaders = exports.metaSearchPlaces = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = void 0;
const loaders_1 = require("./loaders");
function getDefaultSearchPlaces(moduleName) {
    return [
        'package.json',
        `.${moduleName}rc`,
        `.${moduleName}rc.json`,
        `.${moduleName}rc.yaml`,
        `.${moduleName}rc.yml`,
        `.${moduleName}rc.js`,
        `.${moduleName}rc.ts`,
        `.${moduleName}rc.cjs`,
        `.${moduleName}rc.mjs`,
        `.config/${moduleName}rc`,
        `.config/${moduleName}rc.json`,
        `.config/${moduleName}rc.yaml`,
        `.config/${moduleName}rc.yml`,
        `.config/${moduleName}rc.js`,
        `.config/${moduleName}rc.ts`,
        `.config/${moduleName}rc.cjs`,
        `.config/${moduleName}rc.mjs`,
        `${moduleName}.config.js`,
        `${moduleName}.config.ts`,
        `${moduleName}.config.cjs`,
        `${moduleName}.config.mjs`,
    ];
}
exports.getDefaultSearchPlaces = getDefaultSearchPlaces;
function getDefaultSearchPlacesSync(moduleName) {
    return [
        'package.json',
        `.${moduleName}rc`,
        `.${moduleName}rc.json`,
        `.${moduleName}rc.yaml`,
        `.${moduleName}rc.yml`,
        `.${moduleName}rc.js`,
        `.${moduleName}rc.ts`,
        `.${moduleName}rc.cjs`,
        `.config/${moduleName}rc`,
        `.config/${moduleName}rc.json`,
        `.config/${moduleName}rc.yaml`,
        `.config/${moduleName}rc.yml`,
        `.config/${moduleName}rc.js`,
        `.config/${moduleName}rc.ts`,
        `.config/${moduleName}rc.cjs`,
        `${moduleName}.config.js`,
        `${moduleName}.config.ts`,
        `${moduleName}.config.cjs`,
    ];
}
exports.getDefaultSearchPlacesSync = getDefaultSearchPlacesSync;
exports.globalConfigSearchPlaces = [
    'config',
    'config.json',
    'config.yaml',
    'config.yml',
    'config.js',
    'config.ts',
    'config.cjs',
    'config.mjs',
];
exports.globalConfigSearchPlacesSync = [
    'config',
    'config.json',
    'config.yaml',
    'config.yml',
    'config.js',
    'config.ts',
    'config.cjs',
];
// this needs to be hardcoded, as this is intended for end users, who can't supply options at this point
exports.metaSearchPlaces = [
    'package.json',
    'package.yaml',
    '.config/config.json',
    '.config/config.yaml',
    '.config/config.yml',
    '.config/config.js',
    '.config/config.ts',
    '.config/config.cjs',
    '.config/config.mjs',
];
// do not allow mutation of default loaders. Make sure it is set inside options
exports.defaultLoaders = Object.freeze({
    '.mjs': loaders_1.loadJs,
    '.cjs': loaders_1.loadJs,
    '.js': loaders_1.loadJs,
    '.ts': loaders_1.loadTs,
    '.json': loaders_1.loadJson,
    '.yaml': loaders_1.loadYaml,
    '.yml': loaders_1.loadYaml,
    noExt: loaders_1.loadYaml,
});
exports.defaultLoadersSync = Object.freeze({
    '.cjs': loaders_1.loadJsSync,
    '.js': loaders_1.loadJsSync,
    '.ts': loaders_1.loadTsSync,
    '.json': loaders_1.loadJson,
    '.yaml': loaders_1.loadYaml,
    '.yml': loaders_1.loadYaml,
    noExt: loaders_1.loadYaml,
});
//# sourceMappingURL=defaults.js.map