-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.ts
46 lines (43 loc) · 1.33 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { viteMockServe } from 'vite-plugin-mock'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias:{
"@":path.resolve(__dirname,"src"),
"static": path.resolve(__dirname, "static"),
"assets": path.resolve(__dirname, "src/assets"),
"mixins": path.resolve(__dirname, "src/mixins"),
"comps": path.resolve(__dirname, "src/components"),
"views": path.resolve(__dirname, "src/views"),
"plugins": path.resolve(__dirname, "src/plugins"),
"utils": path.resolve(__dirname, "src/utils"),
"api": path.resolve(__dirname, "src/api"),
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData:`
@import "${path.resolve(__dirname, './node_modules/ayin-lessmixins/ayin-lessmixins.less')}";
@import "${path.resolve(__dirname, './node_modules/ayin-color/ayin-color.less')}";
@import "${path.resolve(__dirname, './node_modules/ayin-color/ayin-color-expand.less')}";
`
}
}
},
plugins: [
react(),
viteMockServe({
supportTs: true,
mockPath: 'mock',
})
],
optimizeDeps: {
include: ['ayin-color'],
exclude: ['techui-react-lite']
},
})