import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { viteMockServe } from 'vite-plugin-mock' //import { TanStackRouterVite } from '@tanstack/router-vite-plugin' // https://vitejs.dev/config/ export default defineConfig({ //定义别名的路径 resolve: { alias: { '@': '/src', }, }, server: { proxy: { '/api': { target: 'http://47.113.117.106:8000', changeOrigin: true, rewrite: (path) => path } } }, plugins: [ react(), viteMockServe({ // 是否启用 mock 功能(默认值:process.env.NODE_ENV !== 'production') enable: false, // mock 文件的根路径,默认值:'mocks' mockPath: 'mock', logger: true, }), //TanStackRouterVite(), ], })