refactor(api): 统一API路径配置并优化相关服务调用
All checks were successful
test/timeline-frontend/pipeline/head This commit looks good
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:
@@ -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;
|
||||
// },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user