Generate React Lib is a command-line tool that helps you quickly create a React component library with a pre-configured Rollup bundler setup. This tool simplifies the process, allowing you to focus on building your components while taking care of the build configuration.
- Quick Setup: Generate a fully configured React library in seconds.
- Rollup Bundler: Pre-configured Rollup setup for optimal bundling.
- TypeScript Support: Includes TypeScript configuration out of the box.
- Ready for Publishing: Your library is ready to be published on npm with minimal setup.
To use this package, install it globally using npm:
npm install -g generate-react-lib
Once installed, you can create a new React library by running the following command:
generate-react-lib name 'library-name'
Replace 'library-name' with the desired name of your library.
This will create a new directory named library-name with the initial setup for your React library.
Install Dependencies:
npm install
npm run build
This command will generate the necessary build artifacts in a format suitable for publishing to npm.
If you want to publish your library to npm, follow the npm publishing guide to publish the package.
After running the generate-react-lib command, your project directory will include:
src/: Source files for your library. dist/: Build output directory. package.json: NPM package configuration. rollup.config.js: Rollup configuration file.