storybook: Webpack5 Builder - Stories cannot be explicitly sorted

Describe the bug

I just updated from the Webpack 4 Builder to Webpack 5, and my stories are suddenly sorted differently. Specifically, whereas they used to display in order of export, they now sort alphabetically. In other words, the below code would produce a storybook with Later showing up before MeFirst

// This would show up first
export const MeFirst = ...
// This would show up later, even though L precedes M
export const Later = ...

Looked at the sorting docs, and the objects passed to the storySort option in parameters, but it appears the native export order is not given to this sorting function. Is there any way to have the order of the story exports determine their appearance?

System

  System:
    OS: macOS 12.0.1
    CPU: (10) x64 Apple M1 Pro
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    npm: 7.5.3 - ~/.nvm/versions/node/v12.13.0/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Firefox: 96.0.2
    Safari: 15.1
  npmPackages:
    @storybook/addon-a11y: ^6.4.19 => 6.4.19 
    @storybook/addon-actions: ^6.4.19 => 6.4.19 
    @storybook/addon-essentials: ^6.4.19 => 6.4.19 
    @storybook/addon-links: ^6.4.19 => 6.4.19 
    @storybook/builder-webpack5: ^6.4.19 => 6.4.19 
    @storybook/manager-webpack5: ^6.4.19 => 6.4.19 
    @storybook/node-logger: ^6.4.19 => 6.4.19 
    @storybook/preset-create-react-app: ^4.0.1 => 4.0.1 
    @storybook/preset-scss: ^1.0.3 => 1.0.3 
    @storybook/react: ^6.4.19 => 6.4.19 

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Thanks for your interest! In the future, you can receive updates by clicking the “subscribe” button on the right side of the page. 😄