admin管理员组文章数量:1422560
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/
本文标签:
版权声明:本文标题:javascript - Storybook 6 - Error: You have both a "main" and a "config". Please remove the & 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745370544a2655711.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论