fix(dev): fix play auto import (#4031)

This commit is contained in:
三咲智子 2021-10-26 17:09:14 +08:00 committed by GitHub
parent 65a29f2a2b
commit 2bd4d533e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,17 +1,32 @@
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import './vite.init'
import { epRoot, pkgRoot } from '../build/utils/paths'
export default defineConfig({
resolve: {
alias: [
{
find: /^element-plus$/,
replacement: path.resolve(epRoot, 'index.ts'),
},
{
find: /^element-plus\/(es|lib)\/(.*)$/,
replacement: `${pkgRoot}/$2`,
},
],
},
server: {
host: true,
},
plugins: [
vue(),
Components({
resolvers: ElementPlusResolver(),
include: `${__dirname}/**`,
resolvers: ElementPlusResolver({ importStyle: 'sass' }),
}),
],
})