Core: use __orderedExports if provided to support source order in es module imports

This commit is contained in:
Thomas Allmer 2019-12-18 11:02:31 +01:00
parent 06673e7069
commit 844c371e05

View File

@ -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,