-
Notifications
You must be signed in to change notification settings - Fork 0
feat: migrate from Vite to rslib for bundling #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e-packages-unified-build
- Replace Vite with rslib for both library and CDN builds - Add rslib.config.ts for NPM library build (ESM/CJS formats) - Add rslib.config.cdn.ts for CDN IIFE build with global exposure - Update package.json with rslib dependencies and new build scripts - Remove Vite-related dependencies and configurations - Implement Storybook integration with storybook-addon-rslib - Fix CSS injection for shadow DOM compatibility with rslib's injectStyles - Update mount.tsx to filter and copy toolbar styles to shadow DOM - Generate source maps for both library and CDN builds - Maintain backward compatibility for existing integrations
.join('\n'); | ||
|
||
if (toolbarStyles) { | ||
style.textContent = toolbarStyles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VIte has special plugin which made the prev approach possible. RSLib doesn't have that so we're resorting to this verbose approach for now
…brary build - Remove VanillaExtractPlugin from library config (only needed for CDN build) - Library consumers handle their own CSS processing - CDN build still includes VanillaExtractPlugin for style bundling - Both builds maintain React plugin for JSX/TSX transformation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phenomenal to have this migrated back to rslib!
Update Storybook to 9.1.10, resolving peer dependency issues Update @launchpad-ui packages
"sideEffects": false, | ||
"files": [ | ||
"dist", | ||
"cdn", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this intentional? @sub-ld The hook loads the toolbar from unpkg at /cdn/toolbar.min.js, which won't exist if cdn isn't published to npm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I didnt realize that is how we host the cdn. Thanks I'll change this
🚀 Migration from Vite to rslib
This PR migrates the LaunchDarkly Toolbar from Vite to rslib for both library and CDN builds, providing better performance and more consistent bundling.
✅ What's Changed
Build System Migration
Storybook Integration
CSS & Shadow DOM Fixes
Build Outputs
📊 Bundle Analysis
🔧 Technical Details
🧪 Testing
📝 Migration Notes
This migration provides a more robust and performant build system while maintaining full backward compatibility.