50 lines
1.0 KiB
JavaScript
50 lines
1.0 KiB
JavaScript
// @ts-check
|
|
import { withSentryConfig } from '@sentry/nextjs';
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
experimental: {
|
|
proxyTimeout: 90_000,
|
|
},
|
|
reactStrictMode: false,
|
|
transpilePackages: ['crypto-hash'],
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'http',
|
|
hostname: '**',
|
|
},
|
|
{
|
|
protocol: 'https',
|
|
hostname: '**',
|
|
},
|
|
],
|
|
},
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/api/uploads/:path*',
|
|
destination:
|
|
process.env.STORAGE_PROVIDER === 'local' ? '/uploads/:path*' : '/404',
|
|
permanent: true,
|
|
},
|
|
];
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/uploads/:path*',
|
|
destination:
|
|
process.env.STORAGE_PROVIDER === 'local'
|
|
? '/api/uploads/:path*'
|
|
: '/404',
|
|
},
|
|
];
|
|
},
|
|
};
|
|
export default withSentryConfig(nextConfig, {
|
|
org: process.env.SENTRY_ORG,
|
|
project: process.env.SENTRY_PROJECT,
|
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
});
|