diff --git a/bin/build/index.js b/bin/build/index.js index d9aa98d9..54ce89e0 100644 --- a/bin/build/index.js +++ b/bin/build/index.js @@ -44,7 +44,7 @@ const tasks = new Listr( { title: 'Fetching icons', task: async (ctx) => { - ctx.tasks = { global: { rootDir, defaultVariant }, icons: {} }; + ctx.tasks = { global: { defaultVariant }, icons: {} }; const iconsVariantsDirs = Object.fromEntries( iconsVariants.map((variant) => [ @@ -84,7 +84,14 @@ const tasks = new Listr( Object.entries(targets).map(([targetName, targetConfig]) => ({ title: targetConfig.title, enabled: () => ctx.cliTargets.length === 0 || ctx.cliTargets.includes(targetName), - task: async (ctx) => ctx.pool.run({ targetName, config: ctx.tasks, targetConfig }), + task: (ctx) => { + targetConfig.path = path.join( + rootDir, + ...targetConfig.path.split(path.posix.sep), + ); + + return ctx.pool.run({ targetName, config: ctx.tasks, targetConfig }); + }, })), { concurrent: true, exitOnError: false }, ), diff --git a/bin/build/worker.js b/bin/build/worker.js index aaf1f8c0..a9fd8782 100644 --- a/bin/build/worker.js +++ b/bin/build/worker.js @@ -1,14 +1,7 @@ -import path from 'node:path'; - export default async ({ targetName, config, targetConfig }) => { const { default: task } = await import( `./targets/${targetConfig.target || targetName}/index.js` ); - targetConfig.path = path.join( - config.global.rootDir, - ...targetConfig.path.split(path.posix.sep), - ); - return task(config, targetConfig); };