-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
41 lines (41 loc) · 949 Bytes
/
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
import react from '@vitejs/plugin-react-swc';
import autoprefixer from 'autoprefixer';
import path from 'path';
import tailwindcss from 'tailwindcss';
import { defineConfig } from 'vite';
//确定路径重命名
const pathSrc = path.resolve(__dirname, 'src');
const pathTypes = path.resolve(__dirname, 'types');
// https://vitejs.dev/config/
export default defineConfig({
base: '/rrfe-pro/',
build: {
outDir: 'build',
},
resolve: {
alias: {
'~/': `${pathTypes}/`,
'@/': `${pathSrc}/`,
},
},
plugins: [react()],
css: {
postcss: {
plugins: [autoprefixer({}), tailwindcss],
},
},
server: {
hmr: { overlay: false },
host: '0.0.0.0',
port: 8011,
open: true,
cors: true,
proxy: {
'/api': {
target: 'https://be-dev.redrock.cqupt.edu.cn',
changeOrigin: true,
rewrite: (path: string): string => path.replace(/^\/api/, ''),
},
},
},
});