Skip to content

Commit 2e6c54c

Browse files
committed
feat: add Vercel Speed Insights integration for performance analysis
1 parent 473cb01 commit 2e6c54c

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

app/layout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { RootProvider } from "fumadocs-ui/provider";
44
import Script from "next/script";
55
import "./globals.css";
66
import { ThemeProvider } from "@/app/components/ThemeProvider";
7+
import { SpeedInsights } from "@vercel/speed-insights/next";
78

89
const geistSans = localFont({
910
src: "./fonts/GeistVF.woff",
@@ -51,6 +52,7 @@ export default function RootLayout({
5152
<div className="relative z-10">{children}</div>
5253
</ThemeProvider>
5354
</RootProvider>
55+
{/* 谷歌分析 */}
5456
<Script
5557
src="https://www.googletagmanager.com/gtag/js?id=G-ED4GVN8YVW"
5658
strategy="afterInteractive"
@@ -64,6 +66,8 @@ export default function RootLayout({
6466
gtag('config', 'G-ED4GVN8YVW');
6567
`}
6668
</Script>
69+
{/* 性能分析 */}
70+
<SpeedInsights />
6771
</body>
6872
</html>
6973
);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@radix-ui/react-dialog": "^1.1.15",
1818
"@radix-ui/react-slot": "^1.2.3",
1919
"@types/mdx": "^2.0.13",
20+
"@vercel/speed-insights": "^1.2.0",
2021
"antd": "^5.27.3",
2122
"class-variance-authority": "^0.7.1",
2223
"clsx": "^2.1.1",

pnpm-lock.yaml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)