The create-react-widget CLI tool is designed to simplify the process of creating web widgets using ReactJS. This tool sets up a template project that leverages React, Axios, Webpack, and React Router DOM to create embeddable widgets for web applications.
- Quickly create a project template for web widgets.
- Utilizes React for building dynamic user interfaces.
- Integrates Axios for making HTTP requests.
- Uses Webpack for bundling and managing assets.
- Includes React Router DOM for easy navigation within the widget. (Uses virtual routing)
Install the create-react-widget CLI tool globally using npm or yarn:
npm install -g create-react-widget
# or
yarn global add create-react-widget
To create a new widget project, run the following command:
create-react-widget my-widget
cd my-widget
Replace my-widget with the name of your widget project. This command will create a new directory containing the project files and dependencies.
To run the project in development mode, use the following command:
npm run dev
This command will start the webpack development server, and you can access the widget at http://localhost:8080.
For a production-like environment with the webpack development server, use:
npm run devprod
To build the project for production, run:
npm run prod
This will generate optimized files in the dist
directory.
Run tests using the following command:
npm run test
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue.
This project is licensed under the MIT License - see the LICENSE file for details.