.
This commit is contained in:
parent
907845feb1
commit
5050f9f7b6
1 changed files with 8 additions and 8 deletions
|
@ -42,30 +42,28 @@ react-modern-library-cli
|
|||
|
||||
After you answer some basic prompts about your module, the CLI will perform the following:
|
||||
- copy over the template to a new folder in the current directory
|
||||
- initialize yarn or npm package manager
|
||||
- install dependencies via yarn or npm
|
||||
- link packages together for development
|
||||
- initialize local git repo
|
||||
|
||||
At this point, you're new module is all setup for local development.
|
||||
At this point, your new module is all setup for local development.
|
||||
|
||||
## Development
|
||||
|
||||
#### Local Development
|
||||
|
||||
Local development is broken into two parts.
|
||||
|
||||
Note: if you're using yarn, you can skip the `yarn link` steps, as the generated module's example includes a local-link by default.
|
||||
First, you'll run rollup to watch your `src/` module and automatically recompile it into `dist/` whenever you make changes.
|
||||
|
||||
```bash
|
||||
npm start # runs rollup with watch flag => dist
|
||||
npm start # runs rollup with watch flag
|
||||
```
|
||||
|
||||
The second part will be running our `example/` create-react-app that's linked to the local version of your module.
|
||||
The second part will be running the `example/` create-react-app that's linked to the local version of your module.
|
||||
|
||||
```bash
|
||||
# (in another tab)
|
||||
cd example
|
||||
npm link <your-module-name> # you may skip this if using yarn
|
||||
npm link <your-module-name> # optional if using yarn
|
||||
npm start # runs create-react-app dev server
|
||||
```
|
||||
|
||||
|
@ -73,6 +71,8 @@ Now, anytime you make a change to your component in `src/` or to the example app
|
|||
|
||||

|
||||
|
||||
Note: if you're using yarn, there is no need to use `yarn link`, as the generated module's example includes a local-link by default.
|
||||
|
||||
#### NPM Stuffs
|
||||
|
||||
The only difference when publishing your component to **npm** is to make sure you add any npm modules you want as peer dependencies are properly marked as `peerDependencies` in `package.json`. The rollup config will automatically recognize them as peer dependencies and not try to bundle them in your module.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue