Add Vercel Speed Insights to your project #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented Vercel Speed Insights integration for the Rareness project.
Summary
Successfully integrated Vercel Speed Insights into the Rareness web application, a Vite-based vanilla JavaScript project that displays League of Legends skin collections.
Changes Made
Created/Modified Files:
web/package.json - Added @vercel/speed-insights dependency
@vercel/speed-insights(^1.3.1) to dependenciesweb/src/main.js - Integrated Speed Insights initialization
injectSpeedInsightsfunction from '@vercel/speed-insights'injectSpeedInsights()early in the application startup (before DOMContentLoaded)Implementation Details
The integration follows the documentation for "other" frameworks (vanilla JS/Vite). The approach used:
injectSpeedInsights()functionMetrics Tracked
Once deployed to Vercel, Speed Insights will automatically track:
Build & Testing Results
✅ Build successful:
npm run buildproduces optimized production bundle✅ No linting errors introduced by changes
✅ No breaking changes to existing functionality
✅ Package.json properly updated with lock file
Next Steps for Deployment
vercel deployor git push to connected repository)/_vercel/speed-insights/script.jsTechnical Notes
injectSpeedInsights()function is called only once in the app, as requiredFiles Modified
All changes preserve the existing code structure and follow best practices for integrating Speed Insights with vanilla JavaScript applications on Vite.
View Project · Speed Insights
Created by juguk with Vercel Agent