diff --git a/packages/core/build/user.js b/packages/core/build/user.js index 3aac540..baa6fde 100644 --- a/packages/core/build/user.js +++ b/packages/core/build/user.js @@ -1,4 +1,3 @@ -const { gulp, glob, lodash, merge } = require('@pipflow/utils') const { pipeline } = require('../base/utils') module.exports = function userTask(options = {}, done) { @@ -6,15 +5,7 @@ module.exports = function userTask(options = {}, done) { // 1. 自定义处理函数 if (typeof compiler === 'function') { - return compiler( - { - gulp, - glob, - lodash, - merge - }, - done - ) + return compiler(done) } // 2. 自定义处理流程 diff --git a/packages/main/tasks.js b/packages/main/tasks.js index 0e22209..265d6db 100644 --- a/packages/main/tasks.js +++ b/packages/main/tasks.js @@ -101,7 +101,8 @@ if (CC.tasks?.length > 0) { }) // 🍱 所有自定义任务 - task(item.name, done => { + // !使用async函数,防止用户自定义任务无返回值导致报错 + task(item.name, async done => { return taskMap[item.type]?.(item, done) }) }