ny
23 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
import { resolve } from 'node:path';
 
import { defineConfig, loadAndConvertEnv } from '@vben/vite-config';
 
const { createProxy } = await loadAndConvertEnv();
 
function pathResolve(dir: string) {
  // eslint-disable-next-line n/prefer-global/process
  return resolve(process.cwd(), '.', dir);
}
 
export default defineConfig(async () => {
  return {
    application: {},
    vite: {
      server: {
        proxy: createProxy,
      },
      resolve: {
        alias: [
          // #/xxxx => src/xxxx
          {
            find: /@\//,
            replacement: `${pathResolve('src')}/`,
          },
        ],
      },
    },
  };
});