Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Mar 11, 2024
1 parent d392a90 commit f9646dd
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions docs/get-started/react-webpack5.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Storybook for React & Webpack is only supported in [React](?renderer=react) proj

- React ≥ 16.8
- Webpack ≥ 5.0
- Storybook ≥ 7.0
- Storybook ≥ 8.0

## Getting started

Expand Down Expand Up @@ -82,7 +82,43 @@ First, install the framework:

<!-- prettier-ignore-end -->

Then, update your `.storybook/main.js|ts` to change the framework property:
Next, install and register your appropriate compiler addon, depending on whether you're using SWC (recommended) or Babel:

<Callout variant="info">

If your project is using [Create React App](#create-react-app-cra), you can skip this step.

</Callout>

<!-- prettier-ignore-start -->

<CodeSnippets
paths={[
'common/storybook-addon-compiler-swc-auto-install.npm.js.mdx',
'common/storybook-addon-compiler-swc-auto-install.pnpm.js.mdx',
'common/storybook-addon-compiler-swc-auto-install.yarn.js.mdx',
]}
/>

<!-- prettier-ignore-end -->

or

<!-- prettier-ignore-start -->

<CodeSnippets
paths={[
'common/storybook-addon-compiler-babel-auto-install.npm.js.mdx',
'common/storybook-addon-compiler-babel-auto-install.pnpm.js.mdx',
'common/storybook-addon-compiler-babel-auto-install.yarn.js.mdx',
]}
/>

<!-- prettier-ignore-end -->

More details can be found in the [Webpack builder docs](../builders/webpack.md#compiler-support).

Finally, update your `.storybook/main.js|ts` to change the framework property:

<!-- prettier-ignore-start -->

Expand Down

0 comments on commit f9646dd

Please sign in to comment.