UNPKG

413 BJavaScriptView Raw
1'use strict'
2module.exports = initCusomtPlugins
3
4const path = require('path')
5const fileExists = require('file-exists')
6
7function 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}