Skip to content

Move .storybook/config.js #3640

Closed
Closed

Description

Thank you for the excellent job you are doing with Storybook. I am implementing a project in using Storybook as a platform to run automated tests. I want to move the .storybook\config.js to a different path for example C:\StorybookConfigFile\src\application\storybook.storybook\config.js

Is it possible to move the config.js file located on C:\user\app-storybook.storybook to a path such as
C:\StorybookConfigFile\src\application\storybook.storybook\config.js

What need to be changed in the config.js file so the stories still be loaded?

// Loading stories dynamically - automatically import all files ending in *.stories.js
const req = require.context('../src', true, /.stories.js$/)

function loadStories() {
req.keys().forEach((filename) => req(filename))
}
configure(loadStories, module);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions