1 | const tasksConf = require('config').get('tasks')
|
2 | const prepack = require('./prepack.js')
|
3 |
|
4 | const 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 |
|
21 | module.exports = hook
|