-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
49 lines (48 loc) · 1.06 KB
/
vite.config.ts
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
import reactRefresh from '@vitejs/plugin-react-refresh';
import { defineConfig } from 'vite';
// import vitePluginImp from 'vite-plugin-imp'; // 按需引入
import { resolve } from 'path';
export default defineConfig({
base: '/visual-editor-react/',
build: {
outDir: 'dist',
},
optimizeDeps: {
include: [],
},
plugins: [
reactRefresh(),
// vitePluginImp({
// libList: [
// {
// libName: "antd",
// style: (name) => `antd/lib/${name}/style/index.less`,
// },
// ],
// }),
],
// esbuild: {
// jsxInject: "import React from 'react'",
// },
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
css: {
preprocessorOptions: {
less: {
// 支持内联 JavaScript
javascriptEnabled: true,
// 重写 less 变量,定制样式
modifyVars: {
'@primary-color': '#eb2f96',
},
},
scss: {
// 自动导入全局样式
additionalData: "@import '@/styles/base.scss';",
},
},
},
});