video-flow-b/next.config.js
2025-07-04 18:38:29 +08:00

50 lines
1.0 KiB
JavaScript

import { BASE_URL } from './api/constants';
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
images: {
unoptimized: true
},
webpack: (config, { dev, isServer }) => {
if (dev && !isServer) {
// 开发环境优化
config.optimization.splitChunks = {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
priority: 20,
},
default: {
chunks: 'async',
minChunks: 2,
priority: 10,
reuseExistingChunk: true,
},
},
};
}
return config;
},
async rewrites() {
return [
{
source: '/api/proxy/:path*',
destination: 'https://77.smartvideo.py.qikongjian.com/:path*',
},
{
source: '/api/resources/:path*',
destination: BASE_URL+'/:path*',
},
];
},
};
module.exports = nextConfig;