1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
| import vue from '@vitejs/plugin-vue'
| import { defineConfig } from 'vite'
| import Components from 'unplugin-vue-components/vite'
| import {AntDesignVueResolver} from 'unplugin-vue-components/resolvers'
|
| import path from 'path'
| // https://vitejs.dev/config/
| export default defineConfig(({ command, mode }) => {
| return {
| // 项目插件
| plugins: [
| vue(),
| Components({
| resolvers:[
| AntDesignVueResolver({
| importStyle: false, // css in js
| }),
| ]
| })
| ],
| // 基础配置
| base: './',
| publicDir: 'public',
| resolve: {
| alias: {
| '@': path.resolve(__dirname, 'src'),
| },
| },
| css: {
| preprocessorOptions: {
| less: {
| modifyVars: {
| '@border-color-base': '#dce3e8',
| },
| javascriptEnabled: true,
| },
| },
| },
| build: {
| outDir: 'dist',
| assetsDir: 'assets',
| assetsInlineLimit: 4096,
| cssCodeSplit: true,
| brotliSize: false,
| sourcemap: false,
| minify: 'terser',
| terserOptions: {
| compress: {
| // 生产环境去除console及debug
| drop_console: false,
| drop_debugger: true,
| },
| },
| },
| }
| })
|
|