diff --git a/src/config.ts b/src/config.ts index 5d5fbc87..d1015e1a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,7 +14,15 @@ const reversePathsToWalk = ({ folder, path }) => { } const configLookup = (file: string, folder: string, path: any = importedPath) => - uniq(reversePathsToWalk({ folder, path }).map((p) => path.join(p, file))) + uniq( + reversePathsToWalk({ folder, path }) + .map((p) => [ + path.join(p, file), + path.join(p, file).replace(/.js$/, '.cjs'), + path.join(p, file).replace(/.js$/, '.mjs'), + ]) + .flat(), + ) class ConfigResolver { configFile: string diff --git a/src/prompt.ts b/src/prompt.ts index ea702398..fc2617da 100644 --- a/src/prompt.ts +++ b/src/prompt.ts @@ -5,10 +5,17 @@ import helpers from './helpers' const hooksfiles = [ 'index.js', + 'index.cjs', + 'index.mjs', 'index.ts', - 'prompt.cjs', + 'index.cts', + 'index.mts', 'prompt.js', + 'prompt.cjs', + 'prompt.mjs', 'prompt.ts', + 'prompt.cts', + 'prompt.mts', ] const prompt = async ( createPrompter: () => Prompter,