-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
53 lines (52 loc) · 1.47 KB
/
vite.config.ts
File metadata and controls
53 lines (52 loc) · 1.47 KB
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import deno from "@deno/vite-plugin";
import {viteStaticCopy} from "vite-plugin-static-copy";
import {IduxResolver} from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import * as path from "node:path";
import WindiCSS from 'vite-plugin-windicss';
import {VITE_SERVICE_URL} from './env.ts'
// https://vite.dev/config/
export default defineConfig({
server: {
port: 3000,
proxy: {
"/api": {
target: VITE_SERVICE_URL,
changeOrigin: true,
},
},
},
preview: {
port: 3000,
proxy: {
"/api": {
target: VITE_SERVICE_URL,
changeOrigin: true,
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src")
}
},
plugins: [vue(), deno(),WindiCSS(), viteStaticCopy({
targets: [
{
src: "./node_modules/@idux/components/icon/assets/*.svg",
dest: "idux-icons",
},
],
}), Components({
resolvers: [IduxResolver()],
// 可以通过指定 `importStyle` 来按需加载 css 或 less 代码
// 主题默认会通过 IxThemeProvider 自动插入,但如果使用 IxThemeProvider,可以配置 `importStyleTheme` 来引入组件的 css 变量
// 别忘了修改 idux.ts 中的样式导入代码
// resolvers: [IduxResolver({ importStyle: 'css', importStyleTheme: 'default' })],
}),],
optimizeDeps: {
include: ["react/jsx-runtime"],
},
})