-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
66 lines (65 loc) · 1.53 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx';
import { visualizer } from 'rollup-plugin-visualizer';
import path from 'path';
import ElementPlus from 'unplugin-element-plus/vite';
// https://vitejs.dev/config/
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData(source: string, filename: string): Promise<string> {
const absoluteThemeFileName = path.resolve(__dirname, './src/assets/css/_theme.scss');
const relativeThemeFileName = path.relative(path.dirname(filename), absoluteThemeFileName);
const result = `
@import '${relativeThemeFileName}';
${source}
`;
return Promise.resolve(result);
}
}
}
},
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment'
},
plugins: [
vue(),
vueJsx(),
ElementPlus()
],
resolve: {
alias: [
{ find: "@", replacement: path.resolve(__dirname, 'src') }
],
},
build: {
minify: true,
sourcemap: true,
rollupOptions: {
plugins: [
visualizer(
{
filename: path.resolve(__dirname, 'stats.html'),
template: 'treemap',
sourcemap: true
}
)
]
}
},
server: {
proxy: {
'/webapi': {
target: 'http://192.168.1.4:18888',
changeOrigin: true
},
'/login': {
target: 'http://192.168.1.4:18888',
changeOrigin: true
}
}
}
})