Storybook: docs: what are the differences between `main.js`, `preview.js`, `manager.js`?

Created on 22 Jan 2020  路  9Comments  路  Source: storybookjs/storybook

Issue

Can't find any documentation about what the difference between main.js, preview.js, manager.js.
when should I use/choose each one? what are their lifecycle (I mean do they load before/after the env)?

core question / support

All 9 comments

@lidoravitan can you review this PR and add questions as comments there?

@shilman sure I'm on it! thanks for response

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

What are after all the differences between all these different files???

It's nowhere to be found in the docs. Take "Using addons" for example; the docs say to add something to main.js, then later in a section entitled "global configuration" it says "To do that, you can add your decorators to a config file, typically in .storybook/preview.js.", but nowhere is it explained what "typically" even means.

I don't know what I should put in preview.js vs main.js

cc @ndelangen

Here's where it's explained, but it's missing in the docs for some reason:
https://github.com/storybookjs/storybook/blob/next/docs/src/pages/configurations/overview/index.md

@shilman do we deploy the docs for next somewhere somehow?

@ndelangen No because of the whole "frontpage" / "docs" split. I think we need to patch that into master. It came in on this PR, but didn't have the patch label:

https://github.com/storybookjs/storybook/pull/9552

I'll do the patch now. Thanks!

You have it all nicely explained here by @shilman - Migration docs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hckhanh picture hckhanh  路  69Comments

tycho01 picture tycho01  路  76Comments

joeruello picture joeruello  路  79Comments

enagy27 picture enagy27  路  69Comments

moimikey picture moimikey  路  67Comments