From 5f8d916852b493f9fa35f6900285ba64cf9a0da3 Mon Sep 17 00:00:00 2001 From: chenyanqun Date: Fri, 25 Jul 2025 09:49:32 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=9B=B4=E6=96=B0next.config.js?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=B5=8C=E5=85=A5=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/next.config.js | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/web/next.config.js b/web/next.config.js index 847a5f6b32..f1c69ded6e 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -27,20 +27,20 @@ const nextConfig = { basePath, assetPrefix, webpack: (config, { dev, isServer }) => { - config.plugins.push(codeInspectorPlugin({ bundler: "webpack" })); - return config; + config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' })) + return config }, productionBrowserSourceMaps: false, // enable browser source map generation during the production build // Configure pageExtensions to include md and mdx - pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"], + pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], // https://nextjs.org/docs/messages/next-image-unconfigured-host images: { - remotePatterns: remoteImageURLs.map((remoteImageURL) => ({ - protocol: remoteImageURL.protocol.replace(":", ""), + remotePatterns: remoteImageURLs.map(remoteImageURL => ({ + protocol: remoteImageURL.protocol.replace(':', ''), hostname: remoteImageURL.hostname, port: remoteImageURL.port, pathname: remoteImageURL.pathname, - search: "", + search: '', })), }, experimental: {}, @@ -50,17 +50,17 @@ const nextConfig = { // your project has ESLint errors. ignoreDuringBuilds: true, dirs: [ - "app", - "bin", - "config", - "context", - "hooks", - "i18n", - "models", - "service", - "test", - "types", - "utils", + 'app', + 'bin', + 'config', + 'context', + 'hooks', + 'i18n', + 'models', + 'service', + 'test', + 'types', + 'utils', ], }, typescript: { @@ -71,30 +71,30 @@ const nextConfig = { async redirects() { return [ { - source: "/", - destination: "/apps", + source: '/', + destination: '/apps', permanent: false, }, - ]; + ] }, - output: "standalone", + output: 'standalone', async headers() { return [ { - source: "/(.*)", // 匹配所有路由 + source: '/(.*)', // 匹配所有路由 headers: [ { - key: "X-Frame-Options", - value: "ALLOWALL", // 或 ALLOWALL(更宽松) + key: 'X-Frame-Options', + value: 'SAMEORIGIN', // 或 ALLOWALL(更宽松) }, { - key: "Content-Security-Policy", - value: `default-src 'none'`, //允许所有 + key: 'Content-Security-Policy', + value: 'frame-ancestors \'self\' *', // 可嵌套来源 }, ], }, - ]; + ] }, -}; +} module.exports = withBundleAnalyzer(withMDX(nextConfig))