This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
<%= options.getComponents().filter(c => !c.async).map(c => {
const exp = c.pascalName === c.export ? c.pascalName : `${c.export} as ${c.pascalName}`
return `export { ${exp} } from '../${relativeToBuild(c.filePath)}'`
}).join('\n') %>
<%= options.getComponents().filter(c => c.async).map(c => {
const exp = c.export === 'default' ? `c.default || c` : `c['${c.export}']`
return `export const ${c.pascalName} = import('../${relativeToBuild(c.filePath)}' /* webpackChunkName: "${c.chunkName}'}" */).then(c => ${exp})`
}).join('\n') %>
+13
View File
@@ -0,0 +1,13 @@
import Vue from 'vue'
<% const globalComponents = options.getComponents().filter(c => c.global && c.async) %>
const globalComponents = {
<%= globalComponents.map(c => {
const exp = c.export === 'default' ? `c.default || c` : `c['${c.export}']`
return ` ${c.pascalName.replace(/^Lazy/, '')}: () => import('../${relativeToBuild(c.filePath)}' /* webpackChunkName: "${c.chunkName}" */).then(c => ${exp})`
}).join(',\n') %>
}
for (const name in globalComponents) {
Vue.component(name, globalComponents[name])
}
+8
View File
@@ -0,0 +1,8 @@
<%
const tags = {}
for (const c of options.getComponents()) {
tags[c.pascalName] = {
description: `Auto imported from ${c.shortPath}`
}
}
%><%= JSON.stringify(tags, null, 2) %>