Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.
This repository was archived by the owner on May 28, 2019. It is now read-only.

Configuring colocated stories #30

Description

@joshwcomeau

Hi,

I'm using React CDK for a collection of components, and I'd like to colocate the stories:

src
|-- components
|---|-- Button
|---|---|-- Button.js
|---|---|-- Button.test.js
|---|---|-- Button.stories.js
|---|-- Input
|---|---|-- Input.js
|---|---|-- Input.test.js
|---|---|-- Input.stories.js

In .storybook/config, I can simply update the loadStories function to do something like this:

const components = require.context('../src/components', true, /.stories.js$/);

function loadStories() {
  components.keys().forEach(filename => components(filename));
}

This works great, but there's a warning at the top of ./storybook/config:

// IMPORTANT
// ---------
// This is an auto generated file with React CDK.
// Do not modify this file.

I'm afraid that my changes will be overwritten, or at the very least, that there's a better way to do this. Please let me know :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions