Skip to content

Commit

Permalink
Split code blocks for easier copy paste (#1448)
Browse files Browse the repository at this point in the history
* Split code blocks for easier copy paste

* Update customBundlerSetup.md
  • Loading branch information
ovidiuch committed Apr 19, 2023
1 parent 0df857c commit 30a3a45
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
24 changes: 20 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

```bash
npm i -D react-cosmos@next
# or
```

Or if you’re using Yarn:

```bash
yarn add --dev react-cosmos@next
```

Expand All @@ -23,7 +27,11 @@ yarn add --dev react-cosmos@next

```bash
npm i -D react-cosmos-plugin-vite@next
# or
```

Or if you’re using Yarn:

```bash
yarn add --dev react-cosmos-plugin-vite@next
```

Expand All @@ -42,7 +50,11 @@ Create `cosmos.config.json` and enable Vite plugin.

```bash
npm i -D react-cosmos-plugin-webpack@next
# or
```

Or if you’re using Yarn:

```bash
yarn add --dev react-cosmos-plugin-webpack@next
```

Expand Down Expand Up @@ -76,7 +88,11 @@ Create `cosmos.config.json` and enable Webpack plugin.

```bash
npm run cosmos
# or
```

Or if you’re using Yarn:

```bash
yarn cosmos
```

Expand Down
8 changes: 6 additions & 2 deletions docs/customBundlerSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ First, install React Cosmos including the DOM package.

```bash
npm i -D react-cosmos@next react-cosmos-dom@next
# or
```

Or if you’re using Yarn:

```bash
yarn add --dev react-cosmos@next react-cosmos-dom@next
```

Expand All @@ -21,7 +25,7 @@ Next, choose a port for the renderer other than the main Cosmos port, say `5050`

Next, start Cosmos with the `--generate-userdeps` CLI flag. This will generate a `cosmos.userdeps.js` module that contains maps of user module imports (fixtures and decorators) as well the renderer config. Feel free to add this file to .gitignore.

Finally, create a web server using your bundler of choice that serves an `index.html`, which loads a JS module with the following code.
Finally, create a web server using your bundler of choice that serves an `index.html`, which loads a JS module with the following code:

```js
import { mountDomRenderer } from 'react-cosmos-dom';
Expand Down

0 comments on commit 30a3a45

Please sign in to comment.