2022-08-24 01:07:06 +00:00
|
|
|
import fs from 'fs'
|
|
|
|
import _puppeteer from './lib/puppeteer.js'
|
|
|
|
import _plugin from './lib/plugin.js'
|
2022-07-23 20:32:10 +00:00
|
|
|
|
2022-08-24 01:07:06 +00:00
|
|
|
const importV3 = async function (file, def, key = 'default') {
|
|
|
|
if (fs.existsSync(process.cwd() + file)) {
|
|
|
|
let obj = await import(`file://${process.cwd()}/${file}`)
|
|
|
|
return obj[key] || def
|
2022-07-30 21:06:00 +00:00
|
|
|
}
|
2022-08-24 01:07:06 +00:00
|
|
|
return def
|
|
|
|
}
|
2022-07-30 21:06:00 +00:00
|
|
|
|
2022-08-24 01:07:06 +00:00
|
|
|
let MysInfo = await importV3('/plugins/genshin/model/mys/mysInfo.js')
|
|
|
|
let plugin = await importV3('lib/plugins/plugin.js', _plugin)
|
|
|
|
let puppeteer = await importV3('/lib/puppeteer/puppeteer.js', _puppeteer)
|
|
|
|
export {
|
|
|
|
plugin,
|
|
|
|
MysInfo,
|
|
|
|
puppeteer
|
2022-07-23 20:32:10 +00:00
|
|
|
}
|