UNPKG

401 BJavaScriptView Raw
1const tasksConf = require('config').get('tasks')
2const prepack = require('./prepack.js')
3
4const hook = async () => {
5 let { beforeHook } = tasksConf
6 let hooks = beforeHook.filter(v => {
7 return typeof v === 'function'
8 })
9
10 for (const index in hooks) {
11 if (hooks.hasOwnProperty(index)) {
12 const fn = hooks[index]
13
14 await fn.call()
15 }
16 }
17
18 prepack()
19}
20
21module.exports = hook