mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 08:01:20 +08:00
Merge pull request #1390 from storybooks/tmeasday-patch-1
Add a FAQ entry for shared config with next
This commit is contained in:
commit
6df3dea8e5
@ -19,3 +19,7 @@ Next automatically defines `React` for all of your files via a babel plugin. You
|
||||
|
||||
1. Adding `import React from 'react'` to your component files.
|
||||
2. Adding a `.babelrc` that includes [`babel-plugin-react-require`](https://www.npmjs.com/package/babel-plugin-react-require)
|
||||
|
||||
### How do I setup Storybook to share Webpack configuration with Next.js?
|
||||
|
||||
You can generally reuse webpack rules fairly easily by placing them in a file that is `require()`-ed from both your `next.config.js` and your `.storybook/webpack.config.js` files. For example, [this gist](https://gist.github.com/metasean/cadd2becd60cc3b295bf49895a56f9b4) sets both next.js and storybook up with global stylesheets.
|
||||
|
Loading…
x
Reference in New Issue
Block a user