Illuminix_nextjs/next.config.mjs
2024-09-18 16:35:40 +08:00

44 lines
1.2 KiB
JavaScript

import { fileURLToPath } from 'url';
import path from 'path';
import createNextIntlPlugin from 'next-intl/plugin';
const withNextIntl = createNextIntlPlugin();
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
formats: ["image/avif", "image/webp"],
remotePatterns: [
{
protocol: "https",
hostname: "typeframes.ai",
port: "",
pathname: "/_next/image/**",
},
],
domains: ['www.typeframes.com'], // 允许从该域名加载图片资源
},
sassOptions: {
includePaths: [path.join(path.dirname(fileURLToPath(import.meta.url)), 'styles')],
},
async rewrites() {
return [
{
source: '/api/:path*',
destination: 'https://www.typeframes.cc/api/:path*/',
},
{
source: '/oauth2callback/:path*',
destination: 'https://www.typeframes.cc/oauth2callback/:path*/',
},
{
source: '/google/:path*',
destination: 'https://www.typeframes.cc/google/:path*/',
},
];
},
};
export default withNextIntl(nextConfig);