From 59507770fad60ecb4daa318c6eccdca2af37cf46 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Fri, 30 Jun 2017 13:12:11 +1000 Subject: [PATCH] Add a FAQ entry for shared config with next --- docs/pages/basics/faq/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/pages/basics/faq/index.md b/docs/pages/basics/faq/index.md index 87a3c3759fc7..b006712b4a86 100644 --- a/docs/pages/basics/faq/index.md +++ b/docs/pages/basics/faq/index.md @@ -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.