增加手动同步库信息脚本

This commit is contained in:
aixianling
2022-09-02 15:36:44 +08:00
parent f68fef4012
commit 8edddb8cda

View File

@@ -9,7 +9,7 @@ const saveApps = app => {
} else return Promise.reject("没有应用")
}
const getAppInfo = (file, apps) => {
if (/[\\\/](App[^\\\/]+)\.vue$/g.test(file)) {
if (/[\\\/](App[A-Z][^\\\/]+)\.vue$/g.test(file)) {
const name = file.replace(/.+[\\\/](App[^\\\/]+)\.vue$/, '$1'),
source = fs.readFileSync(file).toString(),
parsed = compiler.parseComponent(source),
@@ -18,7 +18,7 @@ const getAppInfo = (file, apps) => {
apps.push({
id: file.replace(/\.vue$/, '').replace(/[\\\/]/g, '_'),
label: label || name,
libPath: file.replace(/\.vue$/, ''),
libPath: `/${file.replace(/\.vue$/, '').replace(/[\\\/]/g, '/')}`,
name,
type: 'web'
})