|
|
|
|
@ -27,30 +27,41 @@ 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: {
|
|
|
|
|
},
|
|
|
|
|
experimental: {},
|
|
|
|
|
// fix all before production. Now it slow the develop speed.
|
|
|
|
|
eslint: {
|
|
|
|
|
// Warning: This allows production builds to successfully complete even if
|
|
|
|
|
// your project has ESLint errors.
|
|
|
|
|
ignoreDuringBuilds: true,
|
|
|
|
|
dirs: ['app', 'bin', 'config', 'context', 'hooks', 'i18n', 'models', 'service', 'test', 'types', 'utils'],
|
|
|
|
|
dirs: [
|
|
|
|
|
"app",
|
|
|
|
|
"bin",
|
|
|
|
|
"config",
|
|
|
|
|
"context",
|
|
|
|
|
"hooks",
|
|
|
|
|
"i18n",
|
|
|
|
|
"models",
|
|
|
|
|
"service",
|
|
|
|
|
"test",
|
|
|
|
|
"types",
|
|
|
|
|
"utils",
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
typescript: {
|
|
|
|
|
// https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors
|
|
|
|
|
@ -60,13 +71,30 @@ const nextConfig = {
|
|
|
|
|
async redirects() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: '/',
|
|
|
|
|
destination: '/apps',
|
|
|
|
|
source: "/",
|
|
|
|
|
destination: "/apps",
|
|
|
|
|
permanent: false,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
output: "standalone",
|
|
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: "/(.*)", // 匹配所有路由
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: "X-Frame-Options",
|
|
|
|
|
value: "ALLOWALL", // 或 ALLOWALL(更宽松)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "Content-Security-Policy",
|
|
|
|
|
value: `default-src 'none'`, //允许所有
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
output: 'standalone',
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = withBundleAnalyzer(withMDX(nextConfig))
|
|
|
|
|
|