.
This commit is contained in:
parent
8ba228222c
commit
cadc8b501e
1 changed files with 10 additions and 7 deletions
|
@ -60,9 +60,9 @@ At this point, your new module should resemble this screenshot and is all setup
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Local development is broken into two parts.
|
Local development is broken into two parts. It's ideal to use two tabs for this.
|
||||||
|
|
||||||
First, you'll run rollup to watch your `src/` module and automatically recompile it into `dist/` whenever you make changes.
|
First, run rollup to watch your `src/` module and automatically recompile it into `dist/` whenever you make changes.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm start # runs rollup with watch flag
|
npm start # runs rollup with watch flag
|
||||||
|
@ -83,24 +83,26 @@ Now, anytime you make a change to your library in `src/` or to the example app's
|
||||||
|
|
||||||
#### Publishing to NPM
|
#### Publishing to NPM
|
||||||
|
|
||||||
The only difference when publishing your library to **npm** is to make sure that any npm modules you want as peer dependencies are properly marked as `peerDependencies` in `package.json`. The rollup config will automatically recognize them as peers and not try to bundle them in your module.
|
Publish your package to `npm`:
|
||||||
|
|
||||||
Then publish as per usual.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# note this will build `commonjs` and `es`versions of your module to dist/
|
|
||||||
npm publish
|
npm publish
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will build `cjs` and `es` versions of your module to `dist/`.
|
||||||
|
Make sure that any npm modules you want as peer dependencies are properly marked as `peerDependencies` in `package.json`. The rollup config will automatically recognize them as peers and not try to bundle them in your module.
|
||||||
|
|
||||||
|
|
||||||
#### Github Pages
|
#### Github Pages
|
||||||
|
|
||||||
Deploying the example to github pages is simple. We create a production build of our example `create-react-app` that showcases your library and then run `gh-pages` to deploy the resulting bundle. This can be done as follows:
|
Deploy your example app to GitHub Pages:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run deploy
|
npm run deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will create a production build of the example `create-react-app` that showcases your library and then runs `gh-pages` to deploy the resulting bundle.
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@ -136,6 +138,7 @@ Here are some example libraries that have been bootstrapped with `create-react-l
|
||||||
|
|
||||||
Want to add yours to the list? Submit an [issue](https://github.com/transitive-bullshit/create-react-library/issues/new).
|
Want to add yours to the list? Submit an [issue](https://github.com/transitive-bullshit/create-react-library/issues/new).
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT © [Travis Fischer](https://github.com/transitive-bullshit)
|
MIT © [Travis Fischer](https://github.com/transitive-bullshit)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue