Addon-docs: Add .story.mdx support to preset (#7229)

Addon-docs: Add .story.mdx support to preset
This commit is contained in:
Michael Shilman 2019-06-29 10:17:29 +08:00 committed by GitHub
commit 8b5e8fb153
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,20 +26,8 @@ function webpack(webpackConfig = {}, options = {}) {
...module,
rules: [
...(module.rules || []),
// {
// test: [/\.stories\.(jsx?$|ts?$)/],
// enforce: 'pre',
// use: [
// {
// loader: require.resolve('@storybook/addon-storysource/loader'),
// options: {
// injectParameters: true,
// },
// },
// ],
// },
{
test: /\.stories.mdx$/,
test: /\.(stories|story).mdx$/,
use: [
{
loader: 'babel-loader',
@ -55,7 +43,7 @@ function webpack(webpackConfig = {}, options = {}) {
},
{
test: /\.mdx$/,
exclude: /\.stories.mdx$/,
exclude: /\.(stories|story).mdx$/,
use: [
{
loader: 'babel-loader',
@ -72,11 +60,7 @@ function webpack(webpackConfig = {}, options = {}) {
}
function addons(entry = []) {
return [
...entry,
// require.resolve('@storybook/addon-storysource/register'),
require.resolve('../register'),
];
return [...entry, require.resolve('../register')];
}
module.exports = { webpack, addons };