0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-24 19:17:48 +01:00
wagtail/client/storybook/main.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

module.exports = {
stories: [
'../../client/**/*.stories.mdx',
'../../client/**/*.stories.@(js|tsx)',
{
directory: '../../wagtail/admin/templates/wagtailadmin/shared/',
titlePrefix: 'Shared',
files: '*.stories.*',
},
'../../wagtail/**/*.stories.*',
],
addons: ['@storybook/addon-docs', '@storybook/addon-controls'],
framework: '@storybook/react',
core: {
builder: 'webpack5',
2021-04-24 10:32:24 +02:00
},
webpackFinal: (config) => {
/* eslint-disable no-param-reassign */
const rules = [
{
test: /\.(scss|css)$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
url: false,
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: ['tailwindcss', 'autoprefixer', 'cssnano'],
},
},
},
'sass-loader',
],
},
{
test: /\.(md|html)$/,
type: 'asset/source',
},
];
config.module.rules = config.module.rules.concat(rules);
// Allow using path magic variables to reduce boilerplate in stories.
config.node = {
__filename: true,
__dirname: true,
};
2021-04-24 10:32:24 +02:00
return config;
},
};