basic2/vite/plugins/components.js

14 lines
415 B
JavaScript

import components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default function createComponents(isBuild) {
const resolvers = []
isBuild && resolvers.push(ElementPlusResolver())
return components({
resolvers,
dirs: ['src/components'],
include: [/\.vue$/, /\.vue\?vue/, /\.jsx$/],
dts: false
})
}