From 99b8f4919bb2218afacccbf80716e7656e4a4980 Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 10 Jun 2024 03:25:20 +0000 Subject: [PATCH] Altered vars handling. --- src/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index b245c2d..74c1698 100644 --- a/src/index.js +++ b/src/index.js @@ -33,9 +33,6 @@ module.exports.process = async (env, tasks) => { const files = {}; for(const type of order) { - if(!types.hasOwnProperty(type)) - continue; - if(!(type in types)) throw `${type} is not a supported build task type`; @@ -54,8 +51,9 @@ module.exports.process = async (env, tasks) => { console.info(` => ${task.source}...`); const path = await handler.process(task, vars); - if(typeof task.varsName === 'string') - vars[task.varsGroup ?? ''][task.varsName] = path; + if(typeof task.vars === 'object' && task.vars !== null) + for(const varsGroup in task.vars) + vars[varsGroup][task.vars[varsGroup] === ':source' ? task.source : task.vars[varsGroup]] = path; files[task.source] = path; }