diff --git a/src/create-publish.mts b/src/create-publish.mts index 3593791..c699658 100644 --- a/src/create-publish.mts +++ b/src/create-publish.mts @@ -79,9 +79,7 @@ for await (const absPath of filePaths) { commandModule = commandModule.default; } - if (typeof config === 'function') { - config = config(absPath, commandModule); - } + try { commandModule = commandModule.getInstance(); @@ -96,6 +94,9 @@ for await (const absPath of filePaths) { commandModule.absPath = absPath; modules.push({ commandModule, config }); } + if (typeof config === 'function') { + config = config(absPath, commandModule); + } } const cacheDir = resolve('./.sern');