mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 03:08:21 +08:00
fix(dev): fix play auto import (#4031)
This commit is contained in:
parent
65a29f2a2b
commit
2bd4d533e4
@ -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' }),
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user