1.1 KiB
1.1 KiB
description, argument-hint, tags
| description | argument-hint | tags | |||
|---|---|---|---|---|---|
| Set up Vercel Analytics and Speed Insights |
|
Set up essential Vercel integrations for a React/Vite project.
Tasks
-
Install Vercel Packages
- Install @vercel/analytics
- Install @vercel/speed-insights
-
Add Components to App
- Import Analytics and SpeedInsights from their respective packages
- Add both components to the main App component (typically in src/App.tsx or src/main.tsx)
- For React projects, use
/reactimports (not/next)
-
Create vercel.json for SPA Routing
- Create vercel.json in project root
- Add rewrite rules to serve index.html for all routes
- This fixes 404 errors when accessing routes directly
-
Verify Setup
- Check that both components are rendered in the app
- Test that direct route access works without 404s
Expected Output
After running this command, the project should have:
- Analytics tracking configured
- Speed Insights monitoring configured
- SPA routing properly configured for Vercel deployment