1 |
|
2 | module.exports = initCusomtPlugins
|
3 |
|
4 | const path = require('path')
|
5 | const fileExists = require('file-exists')
|
6 |
|
7 | function initCusomtPlugins (mos, opts) {
|
8 | opts = opts || {}
|
9 | const cwd = opts.cwd || process.cwd()
|
10 | const mosfilePath = path.resolve(cwd, 'mosfile.js')
|
11 | if (fileExists(mosfilePath)) {
|
12 | const mosfile = require(mosfilePath)
|
13 | if (mosfile) {
|
14 | mosfile(mos)
|
15 | }
|
16 | }
|
17 | return mos
|
18 | }
|