๐Ÿ“ฆ lencx / resume

๐Ÿ“„ vite.config.ts ยท 30 lines
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
30import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
import tsconfigPaths from 'vite-tsconfig-paths'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    reactRefresh(),
    tsconfigPaths(),
  ],
  server: {
    proxy: {
      '/github': {
        target: 'https://raw.githubusercontent.com',
        changeOrigin: true,
        // secure: false,
        // ws: true,
        rewrite: (path) => path.replace(/^\/github/, '')
      },
      '/gitee': {
        target: 'https://gitee.com',
        changeOrigin: true,
        // secure: false,
        // ws: true,
        rewrite: (path) => path.replace(/^\/gitee/, '')
      },
    }
  }
})