Skip to content

Commit 0b5fe4e

Browse files
committed
fix(api-core): find forgeConfig file
1 parent 1193d15 commit 0b5fe4e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/api/core/src/util/forge-config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,14 @@ export default async (dir: string): Promise<ResolvedForgeConfig> => {
124124
forgeConfig = packageJSON.config && packageJSON.config.forge ? packageJSON.config.forge : null;
125125
}
126126

127-
if (!forgeConfig || typeof forgeConfig === 'string') {
127+
if (forgeConfig && typeof forgeConfig === 'string') {
128+
const pathToConfig = path.resolve(dir, forgeConfig);
129+
if (!rechoir.prepare(interpret.extensions, pathToConfig, dir)) {
130+
throw new Error(`Not found interpret for config file[${pathToConfig}]`);
131+
}
132+
}
133+
134+
if (!forgeConfig) {
128135
for (const extension of ['.js', ...Object.keys(interpret.extensions)]) {
129136
const pathToConfig = path.resolve(dir, `forge.config${extension}`);
130137
if (await fs.pathExists(pathToConfig)) {

0 commit comments

Comments
 (0)