From 6d3e7f6d817b48a76f4016f7c537c6dd50d245ff Mon Sep 17 00:00:00 2001 From: Philipp Siekmann Date: Fri, 7 Jun 2019 15:11:36 +0200 Subject: [PATCH] adjust README --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be19cc1..7c2e80e 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,13 @@ Then create a file called `addons.js` in your .storybook directory and import th import 'storybook-design-token/register'; ``` -Create a file called `config.js` in your .storybook directory and tell the plugin what stylesheets to parse: +Create a file called `config.js` in your .storybook directory and tell the plugin what files to parse. **Important:** Call `addParameters` before making the `configure` call. ```js // config.js -import { addParameters } from '@storybook/react'; +import { configure, addParameters } from '@storybook/react'; + +// [...] const cssReq = require.context('!!raw-loader!../src', true, /.\.css$/); const cssTokenFiles = cssReq.keys().map(filename => cssReq(filename)); @@ -66,6 +68,10 @@ addParameters({ } } }); + +// [...] + +configure(loadStories, module); ``` Make sure to specify the right path after `!!raw-loader!`. The path has to be relative to your config file location.