c12 0.2.6 → 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 -9
- package/dist/index.mjs +8 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -200,15 +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
|
-
|
|
211
|
-
throw err;
|
|
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();
|
|
212
211
|
}
|
|
213
212
|
return res;
|
|
214
213
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -176,15 +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
|
-
|
|
187
|
-
throw err;
|
|
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();
|
|
188
187
|
}
|
|
189
188
|
return res;
|
|
190
189
|
}
|