paper-ai-release-24-07-21/next.config.js

56 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-01-18 15:46:18 +08:00
/** @type {import('next').NextConfig} */
2024-01-21 23:29:28 +08:00
const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
};
2024-01-18 15:46:18 +08:00
2024-01-28 10:18:20 +08:00
module.exports = nextConfig;
2024-02-29 22:32:42 +08:00
// 配置 @next/bundle-analyzer
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
// 首先使用withBundleAnalyzer包装nextConfig
const enhancedConfig = withBundleAnalyzer(nextConfig);
2024-02-19 16:57:29 +08:00
// Injected content via Sentry wizard below
const { withSentryConfig } = require("@sentry/nextjs");
2024-02-29 22:32:42 +08:00
// 然后使用withSentryConfig包装已增强的配置
2024-02-19 16:57:29 +08:00
module.exports = withSentryConfig(
2024-02-29 22:32:42 +08:00
enhancedConfig,
2024-02-19 16:57:29 +08:00
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
// Suppresses source map uploading logs during build
silent: true,
org: "liuweiqing-limited",
project: "paperai",
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
);