From 37aee144d579c56da4b9d2d5f5280ae7d7b7572f Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 31 Oct 2019 16:04:36 +0100 Subject: [PATCH] Ensure that source for the playground can be presented in Storybook --- storybook/config.js | 3 +-- .../{ => stories}/docs/introduction.story.mdx | 0 .../playground/editor-styles.scss | 0 storybook/{ => stories}/playground/index.js | 0 storybook/{ => stories}/playground/reset.scss | 0 storybook/{ => stories}/playground/style.scss | 0 storybook/webpack.config.js | 23 ++++++++++--------- 7 files changed, 13 insertions(+), 13 deletions(-) rename storybook/{ => stories}/docs/introduction.story.mdx (100%) rename storybook/{ => stories}/playground/editor-styles.scss (100%) rename storybook/{ => stories}/playground/index.js (100%) rename storybook/{ => stories}/playground/reset.scss (100%) rename storybook/{ => stories}/playground/style.scss (100%) diff --git a/storybook/config.js b/storybook/config.js index a67ce06b3d440..78a2ad8a01cde 100644 --- a/storybook/config.js +++ b/storybook/config.js @@ -16,8 +16,7 @@ addDecorator( withA11y ); addDecorator( withKnobs ); configure( [ - require.context( './docs/', true, /\/.+\.mdx$/ ), - require.context( './playground/', true, /index\.js$/ ), + require.context( './stories/', true, /\/.+\.(js|mdx)$/ ), require.context( '../packages/components/src/', true, /\/stories\/.+\.js$/ ), ], module diff --git a/storybook/docs/introduction.story.mdx b/storybook/stories/docs/introduction.story.mdx similarity index 100% rename from storybook/docs/introduction.story.mdx rename to storybook/stories/docs/introduction.story.mdx diff --git a/storybook/playground/editor-styles.scss b/storybook/stories/playground/editor-styles.scss similarity index 100% rename from storybook/playground/editor-styles.scss rename to storybook/stories/playground/editor-styles.scss diff --git a/storybook/playground/index.js b/storybook/stories/playground/index.js similarity index 100% rename from storybook/playground/index.js rename to storybook/stories/playground/index.js diff --git a/storybook/playground/reset.scss b/storybook/stories/playground/reset.scss similarity index 100% rename from storybook/playground/reset.scss rename to storybook/stories/playground/reset.scss diff --git a/storybook/playground/style.scss b/storybook/stories/playground/style.scss similarity index 100% rename from storybook/playground/style.scss rename to storybook/stories/playground/style.scss diff --git a/storybook/webpack.config.js b/storybook/webpack.config.js index 4a3439578f088..beac3811c353a 100644 --- a/storybook/webpack.config.js +++ b/storybook/webpack.config.js @@ -1,17 +1,18 @@ const path = require( 'path' ); module.exports = ( { config } ) => { - config.module.rules.push( { - test: /\/stories\/.+\.js$/, - loaders: [ require.resolve( '@storybook/source-loader' ) ], - enforce: 'pre', - } ); - - config.module.rules.push( { - test: /\.scss$/, - use: [ 'style-loader', 'css-loader', 'sass-loader' ], - include: path.resolve( __dirname, './playground' ), - } ); + config.module.rules.push( + { + test: /\/stories\/.+\.js$/, + loaders: [ require.resolve( '@storybook/source-loader' ) ], + enforce: 'pre', + }, + { + test: /\.scss$/, + use: [ 'style-loader', 'css-loader', 'sass-loader' ], + include: path.resolve( __dirname ), + } + ); return config; };