36 lines
718 B
JavaScript
36 lines
718 B
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// 设置需要转译的包
|
|
transpilePackages: ['swagger-ui-react'],
|
|
|
|
// 禁用严格模式,避免开发时重复渲染
|
|
reactStrictMode: false,
|
|
|
|
webpack: (config, { dev }) => {
|
|
// 添加 CSS 处理规则
|
|
config.module.rules.push({
|
|
test: /\.css$/,
|
|
type: 'asset/source',
|
|
});
|
|
|
|
// 仅在生产环境中排除 Swagger
|
|
if (!dev) {
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
'swagger-ui-react': false,
|
|
};
|
|
}
|
|
|
|
return config;
|
|
},
|
|
|
|
eslint: {
|
|
ignoreDuringBuilds: true,
|
|
},
|
|
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|