mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
3bf9b65c06
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
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',
|
|
},
|
|
webpackFinal: (config) => {
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
const rules = [
|
|
{
|
|
test: /\.(scss|css)$/,
|
|
use: [
|
|
'style-loader',
|
|
'css-loader',
|
|
{
|
|
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,
|
|
};
|
|
|
|
return config;
|
|
},
|
|
};
|