更新配置文件
This commit is contained in:
parent
0bc2511b63
commit
136f88b4c7
@ -1,34 +1,32 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
devIndicators: false, // show dev tools
|
reactStrictMode: true,
|
||||||
productionBrowserSourceMaps: false, // enable browser source map generation during the production build
|
// 压缩优化(Next.js 13+默认启用SWC,无需手动配置)
|
||||||
// Configure pageExtensions to include md and mdx
|
compress: true,
|
||||||
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
|
|
||||||
experimental: {
|
// 图片优化
|
||||||
// appDir: true,
|
images: {
|
||||||
|
formats: ["image/avif", "image/webp"],
|
||||||
|
domains: ["cdn.yourdomain.com"],
|
||||||
},
|
},
|
||||||
// fix all before production. Now it slow the develop speed.
|
|
||||||
eslint: {
|
// 修正后的开发指示器配置
|
||||||
// Warning: This allows production builds to successfully complete even if
|
devIndicators: {
|
||||||
// your project has ESLint errors.
|
position: "bottom-right", // 新版统一用position
|
||||||
ignoreDuringBuilds: true,
|
|
||||||
},
|
|
||||||
typescript: {
|
|
||||||
// https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
|
|
||||||
ignoreBuildErrors: true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 页面扩展名
|
||||||
|
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
|
||||||
|
|
||||||
|
// 路由重写
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: '/files/:path*',
|
source: "/dev-api/:path*",
|
||||||
destination: `${process.env.NEXT_PUBLIC_FILES_URL}/:path*`,
|
destination: "http://192.168.6.9:8085/:path*",
|
||||||
},
|
},
|
||||||
{
|
];
|
||||||
source: '/dev-api/:path*',
|
|
||||||
destination: 'http://192.168.6.9:8085/:path*',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user