2016-12-08 14:08:04 +02:00
|
|
|
const { configure } = require('@kadira/storybook');
|
|
|
|
|
2017-01-11 14:28:45 +02:00
|
|
|
const req = require.context('../src/components', true, /story.js$/)
|
|
|
|
|
2016-12-08 14:08:04 +02:00
|
|
|
function loadStories() {
|
2017-01-11 16:08:47 +02:00
|
|
|
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
|
2016-12-08 14:08:04 +02:00
|
|
|
require('../stories');
|
|
|
|
}
|
|
|
|
|
2017-01-11 14:28:45 +02:00
|
|
|
configure(loadStories, module);
|