diff --git a/bun.lockb b/bun.lockb index 887f51a..8bc7658 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/projects/website/next.config.ts b/projects/website/next.config.ts index c5a37a8..a410d51 100644 --- a/projects/website/next.config.ts +++ b/projects/website/next.config.ts @@ -1,5 +1,6 @@ import { withSentryConfig } from "@sentry/nextjs"; import { format } from "@formkit/tempo"; +import nextBundleAnalyzer from "@next/bundle-analyzer"; import type { NextConfig } from "next"; const nextConfig: NextConfig = { @@ -36,22 +37,28 @@ const nextConfig: NextConfig = { }, }; -export default withSentryConfig(nextConfig, { - org: "scoresaber-reloaded", - project: "frontend", - sentryUrl: "https://glitchtip.fascinated.cc/", - silent: !process.env.CI, - reactComponentAnnotation: { - enabled: true, - }, - tunnelRoute: "/monitoring", - hideSourceMaps: true, - disableLogger: true, - sourcemaps: { - disable: true, - }, - release: { - create: false, - finalize: false, - }, +const withBundleAnalyzer = nextBundleAnalyzer({ + enabled: process.env.ANALYZE === "true", }); + +export default withBundleAnalyzer( + withSentryConfig(nextConfig, { + org: "scoresaber-reloaded", + project: "frontend", + sentryUrl: "https://glitchtip.fascinated.cc/", + silent: !process.env.CI, + reactComponentAnnotation: { + enabled: true, + }, + tunnelRoute: "/monitoring", + hideSourceMaps: true, + disableLogger: true, + sourcemaps: { + disable: true, + }, + release: { + create: false, + finalize: false, + }, + }) +); diff --git a/projects/website/package.json b/projects/website/package.json index 697044d..82469b7 100644 --- a/projects/website/package.json +++ b/projects/website/package.json @@ -6,6 +6,7 @@ "dev": "next dev --turbo", "dev-debug": "cross-env NODE_OPTIONS='--inspect' next dev --turbo", "build": "next build", + "build:analyze": "cross-env ANALYZE=true next build", "start": "next start", "lint": "next lint" }, @@ -13,6 +14,7 @@ "@formkit/tempo": "^0.1.2", "@heroicons/react": "^2.1.5", "@hookform/resolvers": "^3.9.0", + "@next/bundle-analyzer": "^15.0.1", "@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.1.0", @@ -30,6 +32,7 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "comlink": "^4.4.1", + "cross-env": "^7.0.3", "dexie": "^4.0.8", "dexie-react-hooks": "^1.1.7", "framer-motion": "^11.5.4",