From 5e368ec82f63fba3ddd56b968bc436f13cdc2916 Mon Sep 17 00:00:00 2001 From: Timofei Iatsenko Date: Thu, 23 Mar 2023 15:44:13 +0100 Subject: [PATCH] fix(conf): support cjs extension for config and process ESM in js file by Jiti --- packages/conf/src/getConfig.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/conf/src/getConfig.ts b/packages/conf/src/getConfig.ts index 7009876f3..0cb9eadef 100644 --- a/packages/conf/src/getConfig.ts +++ b/packages/conf/src/getConfig.ts @@ -34,6 +34,7 @@ export function getConfig({ const configExplorer = cosmiconfigSync(moduleName, { searchPlaces: [ `${moduleName}.config.js`, + `${moduleName}.config.cjs`, `${moduleName}.config.ts`, `${moduleName}.config.mjs`, "package.json", @@ -45,6 +46,7 @@ export function getConfig({ `.${moduleName}rc.js`, ], loaders: { + ".js": JitiLoader(), ".ts": JitiLoader(), ".mjs": JitiLoader(), },