Storybook 6 - Error: You have both a "main" and a "config". Please remove the "config" file from your configDir

Viewed 4950

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',
  },
});
1 Answers
Related