generated from Xwudao/vite-vue-starter
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
54 lines (54 loc) · 1.32 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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import * as path from 'path';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import AutoImport from 'unplugin-auto-import/vite';
import PurgeIcons from 'vite-plugin-purge-icons';
import { minifyHtml, injectHtml } from 'vite-plugin-html';
// https://vitejs.dev/config/
const resolve = (p: string) => {
return path.resolve(__dirname, p);
};
export default defineConfig({
resolve: {
alias: {
'@': resolve('src'),
},
extensions: ['.ts', '.js', '.mjs'],
},
plugins: [
vue(),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
minifyHtml(),
injectHtml({
data: {
title: '优聚集 多用户导航系统',
injectScript: '',
},
}),
PurgeIcons({
/* PurgeIcons Options */
content: [
'**/*.html',
// '**/*.js',
'**/*.vue', // scan for .vue file as well
],
}),
],
// server: {
// proxy: {
// '/api': {
// target: 'https://api2.ujuji.com',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ''),
// },
// },
// cors: true,
// },
});