dvui更换设置

This commit is contained in:
aixianling
2022-03-25 14:36:46 +08:00
parent 760db2bb82
commit 87231fdb1f
4 changed files with 41 additions and 5 deletions

View File

@@ -114,6 +114,9 @@ const start = () => {
}
})
})).then(prj => new Promise(resolve => {
if (prj == 'dvui') {
return resolve(prj)
}
chalkTag.info('正在生成打包文件...')
let bin = path.join(__dirname, prj.toString(), 'index.js'),
coreApps = cores.map(e => `{name:'${e.name}',component:require('../../${e.component}').default}`),
@@ -124,7 +127,7 @@ const start = () => {
const install = function (Vue) {
if (install.installed) return Promise.resolve()
else{
let contexts = require.context('.', true, /(\\/.+)\\/${prj == 'dvui' ? 'Ai' : 'App'}[^\\/]+\\.vue$/)
let contexts = require.context('.', true, /(\\/.+)\\/App[^\\/]+\\.vue$/)
if (contexts) {
contexts.keys().map(e => {
if (contexts(e).default) {
@@ -160,7 +163,7 @@ const start = () => {
})
})).then(project => new Promise((resolve, reject) => {
fsExtra.readJson(path.join(__dirname, project.toString(), 'package.json'), (err, json) => {
let cmd = `vue-cli-service build --target lib --dest project/${project}/dist project/${project}/index.js --name ${json.name}`
let cmd = `vue-cli-service build --target lib --dest project/${project}/dist project/${project}/${project == 'dvui' ? 'entries' : 'index'}.js --name ${json.name}`
chalkTag.info('正在压缩文件中...')
exec(cmd, {
cwd: path.join(__dirname, '..')