https://github.com/adrianmcli/react-build-lib
A simple utility for compiling your React components to CommonJS modules.
https://github.com/adrianmcli/react-build-lib
Last synced: about 1 year ago
JSON representation
A simple utility for compiling your React components to CommonJS modules.
- Host: GitHub
- URL: https://github.com/adrianmcli/react-build-lib
- Owner: adrianmcli
- Created: 2016-12-26T04:23:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-29T11:59:47.000Z (over 9 years ago)
- Last Synced: 2025-01-17T04:44:24.353Z (about 1 year ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-build-lib
A simple utility for compiling your React components to CommonJS modules.
> Ideally, you should never need to touch Webpack and Babel if all you want to do is to make and publish React components.
This utility uses Babel presets: `react`, `latest`, and `stage-3`.
# How to use
1. Install the package with either `yarn` or `npm`:
```bash
yarn add --dev react-build-lib
npm install --save-dev react-build-lib # or use npm
```
2. Add the following script to your `package.json` file:
```json
"scripts": {
"build:lib": "react-build-lib"
}
```
3. Now, everytime you run `npm run build:lib`, babel will compile all your javascript files in your `src` folder and output a `lib` folder. By default, it will also copy over any other files.
**Note:** You can also set your source and ouput directories by providing two additional arguments:
```
react-build-lib src lib
```
# Also see
[React Build Dist](https://github.com/adrianmcli/react-build-dist)