feat(dev): support multi-entry (#5945)

This commit is contained in:
三咲智子 2022-02-11 11:04:15 +08:00 committed by GitHub
parent 6503e55277
commit 6663f84e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1,8 +1,10 @@
import { createApp } from 'vue'
import App from './src/App.vue'
import '@element-plus/theme-chalk/src/index.scss'
;(async () => {
const apps = import.meta.glob('./src/*.vue')
const name = location.pathname.replace(/^\//, '') || 'App'
const App = (await apps[`./src/${name}.vue`]()).default
const app = createApp(App)
const app = createApp(App)
app.mount('#play')
app.mount('#play')
})()

View File

@ -4,7 +4,7 @@
"allowJs": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"types": ["../typings/global"],
"types": ["vite/client", "../typings/global"],
"resolveJsonModule": true,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,