fix(vite): add library mode build, declare React external, document C… - #155
Merged
Merged
Conversation
…SS setup Fixes Sorokit#104 - Add build.lib configuration to vite.config.ts with proper entry point - Add rollupOptions.external for React, ReactDOM, react/jsx-runtime - Create vite.lib.config.ts for dedicated library builds - Add component index (src/components/index.ts) for clean exports - Update package.json with proper main/module/types/exports fields - Add tsconfig.lib.json for declaration-only compilation - Add CSS setup documentation to README (Tailwind, CSS Modules, custom) - Add build output tests verifying ES/CJS modules and no React bundling npm run build now produces: - dist/sorokit-ui.es.js (ES modules) - dist/sorokit-ui.cjs.js (CommonJS) - dist/index.d.ts (TypeScript definitions) - dist/style.css (Compiled styles)
|
@BernardOnuh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes issue by adding proper Vite library build configuration and resolving three critical packaging issues:
Problems Fixed
1. ❌ No build.lib Entry
npm run build→dist/index.html(app bundle)npm run build→dist/sorokit-ui.es.js+dist/sorokit-ui.cjs.js(library bundle)2. ❌ React Not Declared External
3. ❌ No CSS/Tailwind Documentation
Changes
Files Changed
vite.config.ts- Added library build configurationvite.lib.config.ts- New file for library-only buildssrc/components/index.ts- New file for component exportspackage.json- Added main/module/types/exports fieldstsconfig.lib.json- New TypeScript config for declarationssrc/__tests__/build.test.ts- Tests for build outputREADME.md- Added CSS Setup sectionBuild Output
Closes #104
Before