From 466fe72459542acc54e6e6fcd777df24d73614c2 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Wed, 11 Jan 2017 14:08:47 +0000 Subject: [PATCH] sorting stories alphabetically --- ui/.storybook/config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/.storybook/config.js b/ui/.storybook/config.js index 404a63a1..61c63a83 100644 --- a/ui/.storybook/config.js +++ b/ui/.storybook/config.js @@ -3,7 +3,13 @@ const { configure } = require('@kadira/storybook'); const req = require.context('../src/components', true, /story.js$/) 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'); }