Blame view

Antis.Erp.Plat/douyin/frontend/vite.config.ts 864 Bytes
f946e9dd   hexiaodong   hhh
1
2
  import { fileURLToPath, URL } from 'node:url'
  
319532fb   “wangming”   feat(admin): 添加抖音...
3
  import { defineConfig, loadEnv } from 'vite'
f946e9dd   hexiaodong   hhh
4
5
6
7
  import vue from '@vitejs/plugin-vue'
  import vueDevTools from 'vite-plugin-vue-devtools'
  
  // https://vite.dev/config/
319532fb   “wangming”   feat(admin): 添加抖音...
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
  export default defineConfig(({ mode }) => {
    const env = loadEnv(mode, process.cwd(), '')
    const nccTarget = env.VITE_NCC_PROXY_TARGET || 'http://127.0.0.1:2011'
  
    return {
      plugins: [
        vue(),
        vueDevTools(),
      ],
      resolve: {
        alias: {
          '@': fileURLToPath(new URL('./src', import.meta.url))
        },
      },
      server: {
        port: 5173,
        host: true,
        open: true,
        // 开发时 axios baseURL 用 /api,由这里转发到本机 NCC.API(与 antis-ncc-admin 默认端口一致)
        proxy: {
          '/api': {
            target: nccTarget,
            changeOrigin: true,
          },
        },
f946e9dd   hexiaodong   hhh
33
      },
319532fb   “wangming”   feat(admin): 添加抖音...
34
    }
f946e9dd   hexiaodong   hhh
35
  })