2023-05-24 11:08:08 +08:00
|
|
|
/// <reference types="vitest" />
|
2023-10-17 10:35:21 +08:00
|
|
|
import baseConfig from './vite.config.base';
|
2024-06-14 17:55:37 +08:00
|
|
|
import dotenv from 'dotenv';
|
2023-05-24 11:08:08 +08:00
|
|
|
import { mergeConfig } from 'vite';
|
|
|
|
import eslint from 'vite-plugin-eslint';
|
|
|
|
|
2024-06-14 17:55:37 +08:00
|
|
|
// 注入本地/开发配置环境变量(先导入的配置优先级高)
|
|
|
|
dotenv.config({ path: ['.env.development.local', '.env.development'] });
|
|
|
|
|
2023-05-24 11:08:08 +08:00
|
|
|
export default mergeConfig(
|
|
|
|
{
|
|
|
|
mode: 'development',
|
|
|
|
server: {
|
|
|
|
open: true,
|
|
|
|
fs: {
|
|
|
|
strict: true,
|
|
|
|
},
|
2023-06-02 15:18:59 +08:00
|
|
|
proxy: {
|
2024-01-31 12:28:51 +08:00
|
|
|
'/ws': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2024-01-31 12:28:51 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path: string) => path.replace(/^\/front\/ws/, ''),
|
|
|
|
ws: true,
|
|
|
|
},
|
2023-08-08 16:49:49 +08:00
|
|
|
'/front': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2023-06-02 15:18:59 +08:00
|
|
|
changeOrigin: true,
|
2023-08-08 16:49:49 +08:00
|
|
|
rewrite: (path: string) => path.replace(/^\/front/, ''),
|
2023-06-02 15:18:59 +08:00
|
|
|
},
|
2023-10-31 14:46:03 +08:00
|
|
|
'/file': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2023-10-31 14:46:03 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path: string) => path.replace(/^\/front\/file/, ''),
|
|
|
|
},
|
2024-01-24 13:39:15 +08:00
|
|
|
'/attachment': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2024-01-24 13:39:15 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path: string) => path.replace(/^\/front\/attachment/, ''),
|
|
|
|
},
|
2024-03-19 11:45:55 +08:00
|
|
|
'/bug/attachment': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2024-03-19 11:45:55 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path: string) => path.replace(/^\/front\/bug\/attachment/, ''),
|
|
|
|
},
|
2023-12-04 17:40:42 +08:00
|
|
|
'/plugin/image': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2023-12-04 17:40:42 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path: string) => path.replace(/^\/front\/plugin\/image/, ''),
|
|
|
|
},
|
2023-08-24 16:01:55 +08:00
|
|
|
'/base-display': {
|
2024-06-14 17:55:37 +08:00
|
|
|
target: process.env.VITE_DEV_DOMAIN,
|
2023-08-24 16:01:55 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path: string) => path.replace(/^\/front\/base-display/, ''),
|
|
|
|
},
|
2023-06-02 15:18:59 +08:00
|
|
|
},
|
2023-05-24 11:08:08 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
eslint({
|
|
|
|
cache: false,
|
|
|
|
include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
|
|
|
|
exclude: ['node_modules'],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
baseConfig
|
|
|
|
);
|