12345678910111213141516171819202122232425262728293031 |
- import { defineConfig } from 'vite';
- import react from '@vitejs/plugin-react-swc';
- import path, { resolve } from 'path';
- import { fileURLToPath } from 'node:url';
- var __filename = fileURLToPath(import.meta.url);
- var __dirname = path.dirname(__filename);
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [react()],
- build: {
- target: "esnext",
- },
- resolve: {
- alias: {
- '@src': resolve(__dirname, 'src'),
- '@assets': resolve(__dirname, 'assets'),
- '@': resolve(__dirname, '.'),
- }
- },
- server: {
- host: '0.0.0.0',
- port: 3305,
- proxy: {
- '/api': {
- target: 'https://testadmin.piaoquantv.com/',
- changeOrigin: true,
- rewrite: function (path) { return path.replace(/^\/api/, ''); },
- }
- }
- }
- });
|