1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-14 07:10:05 +02:00

sorting stories alphabetically

This commit is contained in:
Alex Windett 2017-01-11 14:08:47 +00:00
parent 74c061a6cd
commit 466fe72459

View File

@ -3,7 +3,13 @@ const { configure } = require('@kadira/storybook');
const req = require.context('../src/components', true, /story.js$/) const req = require.context('../src/components', true, /story.js$/)
function loadStories() { function loadStories() {
req.keys().forEach((filename) => req(filename)); let stories = req.keys();
stories = stories.sort();
stories.forEach( story => req(story));
// Fallback to stories/index.js file for anything that
// hasn't been moved
require('../stories'); require('../stories');
} }