diff --git a/bin/serve.js b/bin/serve.js index 4833415a..c1c88f6c 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -11,6 +11,18 @@ const getFileInfo = (app, file) => { } else app.style = {navigationBarTitleText: app.label} } + if (/^App/.test(app.name) && app.label) { + let {name, label} = app, + path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) + return apps.list.push({ + id: file.replace(/\.\/?(vue)?/g, '').replace(/[\\\/]/g, '_'), + name, + label, + path, + libPath: file.replace(/[\\\/]/g, '/').replace(/^src(\/.+)\.vue/, '$1'), + type: 'wxwork' + }) + } }