31 lines
564 B
TypeScript
31 lines
564 B
TypeScript
/**
|
|
* @description: 动态导入components
|
|
* @author sundan
|
|
*/
|
|
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
import { unplugin } from 'vite-plugin-unplugin'
|
|
|
|
export const createUnPlugin = (env: Record<string, string>) => {
|
|
return unplugin({
|
|
env,
|
|
imports: [
|
|
'vue',
|
|
'pinia',
|
|
'vue-i18n',
|
|
'vue-router',
|
|
'@vueuse/core',
|
|
{
|
|
axios: [['default', 'axios']],
|
|
},
|
|
],
|
|
resolvers: [
|
|
ElementPlusResolver({
|
|
importStyle: false,
|
|
}),
|
|
],
|
|
dirs: [
|
|
],
|
|
})
|
|
}
|