mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 15:06:36 +08:00
[优化] go 引用调整
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
const devBackendUrl =
|
||||
process.env.NEXT_DEV_BACKEND_URL?.replace(/\/+$/, '') ||
|
||||
'http://127.0.0.1:3000';
|
||||
const enableDevProxy = process.env.NEXT_DEV_PROXY === 'true';
|
||||
|
||||
export default function createNextConfig() {
|
||||
const nextConfig = {
|
||||
output: 'export',
|
||||
pageExtensions: ['ts', 'tsx'],
|
||||
images: {
|
||||
unoptimized: true,
|
||||
},
|
||||
eslint: {
|
||||
dirs: [
|
||||
'app',
|
||||
'components',
|
||||
'features',
|
||||
'hooks',
|
||||
'lib',
|
||||
'store',
|
||||
'tests',
|
||||
'types',
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
if (!enableDevProxy) {
|
||||
return nextConfig;
|
||||
}
|
||||
|
||||
return {
|
||||
...nextConfig,
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: '/api/:path*',
|
||||
destination: `${devBackendUrl}/api/:path*`,
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user