refactor(api): 统一API路径配置并优化相关服务调用
All checks were successful
test/timeline-frontend/pipeline/head This commit looks good

feat: 添加API URL全局配置文件
fix: 修复SSR环境下的窗口对象检查
perf: 优化代理配置路径匹配顺序
style: 移除无用注释和未使用的类型声明
This commit is contained in:
2026-02-27 10:07:03 +08:00
parent 97e4a135e1
commit c1a88ea4da
29 changed files with 392 additions and 225 deletions

View File

@@ -160,56 +160,56 @@ export default defineConfig({
* @name Webpack configuration
* @description Custom webpack configuration for code splitting and optimization
*/
chainWebpack: (config: any) => {
// Ignore Windows system files to prevent Watchpack errors
config.watchOptions({
ignored: [
'**/node_modules',
'**/.git',
'**/C:/DumpStack.log.tmp',
'**/C:/pagefile.sys',
'**/C:/swapfile.sys',
'**/C:/System Volume Information',
'**/C:/$*', // Ignore all system files starting with $
],
});
// chainWebpack: (config: any) => {
// // Ignore Windows system files to prevent Watchpack errors
// config.watchOptions({
// ignored: [
// '**/node_modules',
// '**/.git',
// '**/C:/DumpStack.log.tmp',
// '**/C:/pagefile.sys',
// '**/C:/swapfile.sys',
// '**/C:/System Volume Information',
// '**/C:/$*', // Ignore all system files starting with $
// ],
// });
// Split large vendor libraries into separate chunks
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
// Ant Design and related libraries
antd: {
name: 'antd',
test: /[\\/]node_modules[\\/](@ant-design|antd|@antv|rc-)/,
priority: 20,
},
// React and related libraries
react: {
name: 'react',
test: /[\\/]node_modules[\\/](react|react-dom|react-router|react-router-dom)/,
priority: 20,
},
// Other vendor libraries
vendors: {
name: 'vendors',
test: /[\\/]node_modules[\\/]/,
priority: 10,
},
},
});
// // Split large vendor libraries into separate chunks
// config.optimization.splitChunks({
// chunks: 'all',
// cacheGroups: {
// // Ant Design and related libraries
// antd: {
// name: 'antd',
// test: /[\\/]node_modules[\\/](@ant-design|antd|@antv|rc-)/,
// priority: 20,
// },
// // React and related libraries
// react: {
// name: 'react',
// test: /[\\/]node_modules[\\/](react|react-dom|react-router|react-router-dom)/,
// priority: 20,
// },
// // Other vendor libraries
// vendors: {
// name: 'vendors',
// test: /[\\/]node_modules[\\/]/,
// priority: 10,
// },
// },
// });
// Optimize images
config.module
.rule('images')
.test(/\.(png|jpe?g|gif|webp|svg)$/)
.use('url-loader')
.loader('url-loader')
.options({
limit: 8192, // Inline images smaller than 8KB
name: 'static/images/[name].[hash:8].[ext]',
});
// // Optimize images
// config.module
// .rule('images')
// .test(/\.(png|jpe?g|gif|webp|svg)$/)
// .use('url-loader')
// .loader('url-loader')
// .options({
// limit: 8192, // Inline images smaller than 8KB
// name: 'static/images/[name].[hash:8].[ext]',
// });
return config;
},
// return config;
// },
});