|
|
|
@ -27,20 +27,20 @@ const nextConfig = {
|
|
|
|
basePath,
|
|
|
|
basePath,
|
|
|
|
assetPrefix,
|
|
|
|
assetPrefix,
|
|
|
|
webpack: (config, { dev, isServer }) => {
|
|
|
|
webpack: (config, { dev, isServer }) => {
|
|
|
|
config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
|
|
|
|
config.plugins.push(codeInspectorPlugin({ bundler: "webpack" }));
|
|
|
|
return config
|
|
|
|
return config;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
productionBrowserSourceMaps: false, // enable browser source map generation during the production build
|
|
|
|
productionBrowserSourceMaps: false, // enable browser source map generation during the production build
|
|
|
|
// Configure pageExtensions to include md and mdx
|
|
|
|
// 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
|
|
|
|
// https://nextjs.org/docs/messages/next-image-unconfigured-host
|
|
|
|
images: {
|
|
|
|
images: {
|
|
|
|
remotePatterns: remoteImageURLs.map(remoteImageURL => ({
|
|
|
|
remotePatterns: remoteImageURLs.map((remoteImageURL) => ({
|
|
|
|
protocol: remoteImageURL.protocol.replace(':', ''),
|
|
|
|
protocol: remoteImageURL.protocol.replace(":", ""),
|
|
|
|
hostname: remoteImageURL.hostname,
|
|
|
|
hostname: remoteImageURL.hostname,
|
|
|
|
port: remoteImageURL.port,
|
|
|
|
port: remoteImageURL.port,
|
|
|
|
pathname: remoteImageURL.pathname,
|
|
|
|
pathname: remoteImageURL.pathname,
|
|
|
|
search: '',
|
|
|
|
search: "",
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
experimental: {},
|
|
|
|
experimental: {},
|
|
|
|
@ -50,17 +50,17 @@ const nextConfig = {
|
|
|
|
// your project has ESLint errors.
|
|
|
|
// your project has ESLint errors.
|
|
|
|
ignoreDuringBuilds: true,
|
|
|
|
ignoreDuringBuilds: true,
|
|
|
|
dirs: [
|
|
|
|
dirs: [
|
|
|
|
'app',
|
|
|
|
"app",
|
|
|
|
'bin',
|
|
|
|
"bin",
|
|
|
|
'config',
|
|
|
|
"config",
|
|
|
|
'context',
|
|
|
|
"context",
|
|
|
|
'hooks',
|
|
|
|
"hooks",
|
|
|
|
'i18n',
|
|
|
|
"i18n",
|
|
|
|
'models',
|
|
|
|
"models",
|
|
|
|
'service',
|
|
|
|
"service",
|
|
|
|
'test',
|
|
|
|
"test",
|
|
|
|
'types',
|
|
|
|
"types",
|
|
|
|
'utils',
|
|
|
|
"utils",
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typescript: {
|
|
|
|
typescript: {
|
|
|
|
@ -71,30 +71,30 @@ const nextConfig = {
|
|
|
|
async redirects() {
|
|
|
|
async redirects() {
|
|
|
|
return [
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: '/',
|
|
|
|
source: "/",
|
|
|
|
destination: '/apps',
|
|
|
|
destination: "/apps",
|
|
|
|
permanent: false,
|
|
|
|
permanent: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
output: 'standalone',
|
|
|
|
output: "standalone",
|
|
|
|
async headers() {
|
|
|
|
async headers() {
|
|
|
|
return [
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: '/(.*)', // 匹配所有路由
|
|
|
|
source: "/(.*)", // 匹配所有路由
|
|
|
|
headers: [
|
|
|
|
headers: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: 'X-Frame-Options',
|
|
|
|
key: "X-Frame-Options",
|
|
|
|
value: 'SAMEORIGIN', // 或 ALLOWALL(更宽松)
|
|
|
|
value: "ALLOWALL", // 或 ALLOWALL(更宽松)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: 'Content-Security-Policy',
|
|
|
|
key: "Content-Security-Policy",
|
|
|
|
value: 'frame-ancestors \'self\' *', // 可嵌套来源
|
|
|
|
value: `default-src 'none'`, //允许所有
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = withBundleAnalyzer(withMDX(nextConfig))
|
|
|
|
module.exports = withBundleAnalyzer(withMDX(nextConfig))
|
|
|
|
|