perf: remove Sentry client SDK and lazy-load TipTap (~830KB saved)
- Remove withSentryConfig wrapper from next.config.ts (Sentry was disabled anyway) - Clear instrumentation-client.ts to prevent Sentry client bundle (~400KB) - Lazy-load RichTextClient via next/dynamic in About.tsx and Contact.tsx - Defers TipTap/ProseMirror loading until CMS data arrives (~430KB) - Homepage First Load JS: 1479KB → 646KB (56% reduction) - Shared JS: 182KB → 102KB (44% reduction) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -3,8 +3,6 @@ import dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import bundleAnalyzer from "@next/bundle-analyzer";
|
||||
import createNextIntlPlugin from "next-intl/plugin";
|
||||
import { withSentryConfig } from "@sentry/nextjs";
|
||||
|
||||
// Load the .env file from the working directory
|
||||
dotenv.config({ path: path.resolve(process.cwd(), ".env") });
|
||||
|
||||
@@ -228,42 +226,4 @@ const withBundleAnalyzer = bundleAnalyzer({
|
||||
|
||||
const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
|
||||
|
||||
// Wrap with Sentry
|
||||
export default withSentryConfig(
|
||||
withBundleAnalyzer(withNextIntl(nextConfig)),
|
||||
{
|
||||
// For all available options, see:
|
||||
// https://github.com/getsentry/sentry-webpack-plugin#options
|
||||
|
||||
org: "dk0",
|
||||
project: "portfolio",
|
||||
|
||||
// Only print logs for uploading source maps in CI
|
||||
silent: !process.env.CI,
|
||||
|
||||
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
||||
widenClientFileUpload: true,
|
||||
|
||||
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
||||
tunnelRoute: "/monitoring",
|
||||
|
||||
// Webpack-specific options
|
||||
webpack: {
|
||||
// Automatically annotate React components to show their full name in breadcrumbs and session replay
|
||||
reactComponentAnnotation: {
|
||||
enabled: true,
|
||||
},
|
||||
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
||||
treeshake: {
|
||||
removeDebugLogging: true,
|
||||
},
|
||||
// Enables automatic instrumentation of Vercel Cron Monitors
|
||||
automaticVercelMonitors: true,
|
||||
},
|
||||
|
||||
// Source maps configuration
|
||||
sourcemaps: {
|
||||
disable: false,
|
||||
},
|
||||
}
|
||||
);
|
||||
export default withBundleAnalyzer(withNextIntl(nextConfig));
|
||||
|
||||
Reference in New Issue
Block a user