Skip to content

Commit

Permalink
fix(api-core): find forgeConfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsung committed Oct 9, 2024
1 parent 1193d15 commit 0b5fe4e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/api/core/src/util/forge-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ export default async (dir: string): Promise<ResolvedForgeConfig> => {
forgeConfig = packageJSON.config && packageJSON.config.forge ? packageJSON.config.forge : null;
}

if (!forgeConfig || typeof forgeConfig === 'string') {
if (forgeConfig && typeof forgeConfig === 'string') {
const pathToConfig = path.resolve(dir, forgeConfig);
if (!rechoir.prepare(interpret.extensions, pathToConfig, dir)) {
throw new Error(`Not found interpret for config file[${pathToConfig}]`);
}
}

if (!forgeConfig) {
for (const extension of ['.js', ...Object.keys(interpret.extensions)]) {
const pathToConfig = path.resolve(dir, `forge.config${extension}`);
if (await fs.pathExists(pathToConfig)) {
Expand Down

0 comments on commit 0b5fe4e

Please sign in to comment.