Webpack5 Builder - Stories cannot be explicitly sorted
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Upgrade to Webpack 5 breaking Storybook 5 - Stack Overflow
The Storybook dev-server builds get cached in a local (to the package where Storybook is installed) node_modules directory (whatever-package/ ...
Read more >@storybook/builder-webpack5 | Yarn - Package Manager
▶️ Interactive stories to simulate user behavior and tools to debug it; ⚡️ On-demand architecture for smaller builds and faster load times; ⛸...
Read more >@storybook/builder-webpack5 - npm
Builder implemented with webpack5 and webpack5 -compatible loaders/plugins/config, used by @storybook/core-server to build the preview iframe.
Read more >Stories are not sorted by their export (in production) #15574
Describe the bug In production, stories are not sorted according to their export instead, they are sorted alphabetically. How they should be sorted...
Read more >Configuring Storybook: 6 Tips You Can't Miss | by Zheng Li
As it is clearly stated in Storybook documentation: ... If you're looking to change how your stories are ordered, read about sorting stories...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for your interest! In the future, you can receive updates by clicking the “subscribe” button on the right side of the page. 😄
I open i new ticket for it https://github.com/storybookjs/storybook/issues/18535