A modern, production-ready template for building and publishing React component libraries with TypeScript, TailwindCSS, and Rollup.
Clone this template and install dependencies:
git clone https://github.com/yourusername/your-template-name.git
cd your-template-name
npm install
This template includes several pre-configured npm scripts to help you develop, build, and maintain your package:
# Clean the dist directory
npm run clean
# Build the package for production
npm run build
# Lint TypeScript files
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Format code using Prettier
npm run format
# Type check without emitting files
npm run typecheck
Development:
src
directoryBuilding:
npm run build
to create a production builddist
directoryPublishing:
package.json
with your package detailsexports
and main
fields are correctly setnpm publish
to publish to NPMyour-package-name/
āāā dist/ # Built package output
āāā src/ # Source code
ā āāā components/ # React components
ā āāā utils/ # Utility functions
ā āāā index.ts # Main entry point
āāā rollup.config.js # Rollup configuration
āāā tsconfig.json # TypeScript configuration
āāā .eslintrc.js # ESLint configuration
āāā tailwind.config.js # TailwindCSS configuration
The template includes a pre-configured tsconfig.json
for React and modern JavaScript features. Modify as needed for your use case.
The Rollup configuration supports:
TailwindCSS is configured with:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository