mirror of
https://github.com/supabase/supabase.git
synced 2026-07-02 04:54:28 +08:00
* fix cms types and build --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import { withPayload } from '@payloadcms/next/withPayload'
|
|
|
|
const redirects = async () => {
|
|
const internetExplorerRedirect = {
|
|
destination: '/ie-incompatible.html',
|
|
has: [
|
|
{
|
|
type: 'header',
|
|
key: 'user-agent',
|
|
value: '(.*Trident.*)', // all ie browsers
|
|
},
|
|
],
|
|
permanent: false,
|
|
source: '/:path((?!ie-incompatible.html$).*)', // all pages except the incompatibility page
|
|
}
|
|
|
|
const redirects = [internetExplorerRedirect]
|
|
|
|
return redirects
|
|
}
|
|
|
|
const NEXT_PUBLIC_SERVER_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL
|
|
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
|
: undefined || process.env.NEXT_PUBLIC_SERVER_URL || 'http://localhost:3000'
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
images: {
|
|
remotePatterns: [
|
|
...[NEXT_PUBLIC_SERVER_URL /* 'https://example.com' */].map((item) => {
|
|
const url = new URL(item)
|
|
|
|
return {
|
|
hostname: url.hostname,
|
|
protocol: url.protocol.replace(':', ''),
|
|
}
|
|
}),
|
|
],
|
|
},
|
|
reactStrictMode: true,
|
|
redirects,
|
|
eslint: {
|
|
// We are already running linting via GH action, this will skip linting during production build on Vercel
|
|
ignoreDuringBuilds: true,
|
|
},
|
|
}
|
|
|
|
export default withPayload(nextConfig, { devBundleServerPackages: false })
|