Skip to content

Commit 4a97c67

Browse files
authored
Merge pull request #828 from shrpne/main
Custom config: handle default export
2 parents 94855bf + b65fb17 commit 4a97c67

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,18 @@ const main = async () => {
296296
const { command, options } = await program.execute({ args: process.argv });
297297

298298
let customConfig = null;
299+
let customConfigPath;
299300

300301
if (options.customConfig) {
301302
try {
302-
const customConfigPath = resolve(process.cwd(), options.customConfig);
303-
console.log(`✨ found custom config at: ${customConfigPath}`);
303+
customConfigPath = resolve(process.cwd(), options.customConfig);
304304
customConfig = await import(customConfigPath);
305+
customConfig = customConfig.default || customConfig;
305306
} catch (e) {
306-
/* empty */
307+
console.error("Error loading custom config", e);
308+
}
309+
if (customConfig) {
310+
console.log(`✨ found custom config at: ${customConfigPath}`);
307311
}
308312
}
309313

0 commit comments

Comments
 (0)