I was working with Storybook version 5 and I could have either main.js and config.js files and pass some global styles and other config rules to config.js file, now I want to use Storybook in new project and I have there version 6 already. In version 6 I can't have both config and main files. How to pass config rules in new version of Storybook?
Error: You have both a "main" and a "config". Please remove the "config" file from your configDir
Old config in version 5
import './sass-loader.sass';
import '@fortawesome/fontawesome-free/css/all.min.css';
import '@storybook/addon-console';
import {addDecorator} from '@storybook/react';
import {withConsole} from '@storybook/addon-console';
import {addParameters} from '@storybook/react';
import {INITIAL_VIEWPORTS} from '@storybook/addon-viewport';
addDecorator((storyFn, context) => withConsole()(storyFn)(context));
addParameters({
viewport: {
viewports: INITIAL_VIEWPORTS, // newViewports would be an ViewportMap. (see below for examples)
defaultViewport: 'someDefault',
},
});
I was working with Storybook version 5 and I could have either main.js and config.js files and pass some global styles and other config rules to config.js file, now I want to use Storybook in new project and I have there version 6 already. In version 6 I can't have both config and main files. How to pass config rules in new version of Storybook?
Error: You have both a "main" and a "config". Please remove the "config" file from your configDir
Old config in version 5
import './sass-loader.sass';
import '@fortawesome/fontawesome-free/css/all.min.css';
import '@storybook/addon-console';
import {addDecorator} from '@storybook/react';
import {withConsole} from '@storybook/addon-console';
import {addParameters} from '@storybook/react';
import {INITIAL_VIEWPORTS} from '@storybook/addon-viewport';
addDecorator((storyFn, context) => withConsole()(storyFn)(context));
addParameters({
viewport: {
viewports: INITIAL_VIEWPORTS, // newViewports would be an ViewportMap. (see below for examples)
defaultViewport: 'someDefault',
},
});
Share
Improve this question
asked Nov 24, 2020 at 11:00
Freestyle09Freestyle09
5,54810 gold badges58 silver badges92 bronze badges
1 Answer
Reset to default 4This file now exists as preview.js
https://www.learnstorybook./design-systems-for-developers/react/en/build/
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745370545a4624775.html
评论列表(0条)