Skip to content

Commit

Permalink
Merge pull request #828 from shrpne/main
Browse files Browse the repository at this point in the history
Custom config: handle default export
  • Loading branch information
smorimoto committed Jul 15, 2024
2 parents 94855bf + b65fb17 commit 4a97c67
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,18 @@ const main = async () => {
const { command, options } = await program.execute({ args: process.argv });

let customConfig = null;
let customConfigPath;

if (options.customConfig) {
try {
const customConfigPath = resolve(process.cwd(), options.customConfig);
console.log(`✨ found custom config at: ${customConfigPath}`);
customConfigPath = resolve(process.cwd(), options.customConfig);
customConfig = await import(customConfigPath);
customConfig = customConfig.default || customConfig;
} catch (e) {
/* empty */
console.error("Error loading custom config", e);
}
if (customConfig) {
console.log(`✨ found custom config at: ${customConfigPath}`);
}
}

Expand Down

0 comments on commit 4a97c67

Please sign in to comment.