c12 0.2.4 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -200,14 +200,14 @@ async function resolveConfig(source, opts) {
|
|
|
200
200
|
const res = { config: {}, cwd };
|
|
201
201
|
try {
|
|
202
202
|
res.configFile = jiti.resolve(pathe.resolve(cwd, source), { paths: [cwd] });
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
} catch (_err) {
|
|
204
|
+
}
|
|
205
|
+
if (!fs.existsSync(res.configFile)) {
|
|
206
|
+
return res;
|
|
207
|
+
}
|
|
208
|
+
res.config = jiti(res.configFile);
|
|
209
|
+
if (typeof res.config === "function") {
|
|
210
|
+
res.config = await res.config();
|
|
211
211
|
}
|
|
212
212
|
return res;
|
|
213
213
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -176,14 +176,14 @@ async function resolveConfig(source, opts) {
|
|
|
176
176
|
const res = { config: {}, cwd };
|
|
177
177
|
try {
|
|
178
178
|
res.configFile = jiti.resolve(resolve(cwd, source), { paths: [cwd] });
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
} catch (_err) {
|
|
180
|
+
}
|
|
181
|
+
if (!existsSync(res.configFile)) {
|
|
182
|
+
return res;
|
|
183
|
+
}
|
|
184
|
+
res.config = jiti(res.configFile);
|
|
185
|
+
if (typeof res.config === "function") {
|
|
186
|
+
res.config = await res.config();
|
|
187
187
|
}
|
|
188
188
|
return res;
|
|
189
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c12",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Smart Config Loader",
|
|
5
5
|
"repository": "unjs/c12",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"defu": "^
|
|
23
|
-
"dotenv": "^
|
|
22
|
+
"defu": "^6.0.0",
|
|
23
|
+
"dotenv": "^16.0.0",
|
|
24
24
|
"gittar": "^0.1.1",
|
|
25
25
|
"jiti": "^1.12.14",
|
|
26
|
-
"mlly": "^0.
|
|
26
|
+
"mlly": "^0.5.1",
|
|
27
27
|
"pathe": "^0.2.0",
|
|
28
|
-
"rc9": "^1.2.
|
|
28
|
+
"rc9": "^1.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@nuxtjs/eslint-config-typescript": "latest",
|