diff --git a/lib/core/src/client/preview/start.js b/lib/core/src/client/preview/start.js index 89d2b96ec79..15de1652b72 100644 --- a/lib/core/src/client/preview/start.js +++ b/lib/core/src/client/preview/start.js @@ -379,7 +379,10 @@ export default function start(render, { decorateStory } = {}) { ); } - const { default: meta, ...exports } = fileExports; + const { default: meta, __orderedExports, ...namedExports } = fileExports; + // prefer a user/loader provided `__orderedExports` object if supplied as es module exports + // are ordered alphabetically - see https://github.com/storybookjs/storybook/issues/9136 + const exports = __orderedExports || namedExports; const { title: kindName, id: componentId,