Overview
Thesunpeak build command creates optimized, production-ready JavaScript bundles for your MCP Resources. Each Resource file is built as a separate, standalone bundle.
Output
The build process creates:- Minified JavaScript - Optimized and compressed for minimal file size
- CSS extraction - Unused Tailwind styles removed automatically
- Asset optimization - Static assets with hashed filenames for caching
- Source maps - For debugging production issues
Output Directory
src/resources/*-resource.tsx is built to dist/[name].js, with a corresponding [name].json metadata file.
Automatic Discovery
The build automatically discovers and builds all files matching the pattern:search-resource.tsx+search-resource.json→dist/search.js+dist/search.jsoncalendar-resource.tsx+calendar-resource.json→dist/calendar.js+dist/calendar.json
Metadata JSON Files
The build copies each source*-resource.json file to the dist directory and adds a generated uri field:
uri is generated using the resource name and a build timestamp for cache invalidation.
No entry point configuration needed! The framework handles discovery automatically.
Build Optimizations
Tree Shaking
Unused code is automatically removed from the bundle:Code Splitting
Each Resource is built as a separate bundle:- Reduces initial load time
- Allows independent updates
- Improves caching
CSS Purging
Tailwind CSS automatically removes unused utility classes:- Only classes actually used in your components are included
- Significantly reduces CSS file size
- No manual configuration required
Usage
Deployment
After building, deploy thedist/ directory to any static hosting service:
Deployment Guide
Learn how to deploy your built widgets to production.