2021-04-23 22:25:05 +02:00
|
|
|
module.exports = {
|
2022-02-18 17:07:09 +01:00
|
|
|
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',
|
2021-04-23 22:25:05 +02:00
|
|
|
core: {
|
|
|
|
builder: 'webpack5',
|
2021-04-24 10:32:24 +02:00
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
webpackFinal: (config) => {
|
2022-02-18 16:34:33 +01:00
|
|
|
/* eslint-disable no-param-reassign */
|
2021-12-23 05:21:23 +01:00
|
|
|
|
|
|
|
const rules = [
|
|
|
|
{
|
|
|
|
test: /\.(scss|css)$/,
|
|
|
|
use: [
|
|
|
|
'style-loader',
|
2022-06-09 00:29:38 +02:00
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
url: false,
|
|
|
|
},
|
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
options: {
|
|
|
|
postcssOptions: {
|
2022-02-27 17:08:38 +01:00
|
|
|
plugins: ['tailwindcss', 'autoprefixer', 'cssnano'],
|
2021-12-23 05:21:23 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'sass-loader',
|
|
|
|
],
|
|
|
|
},
|
2022-02-18 16:34:33 +01:00
|
|
|
{
|
|
|
|
test: /\.(md|html)$/,
|
|
|
|
type: 'asset/source',
|
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
config.module.rules = config.module.rules.concat(rules);
|
|
|
|
|
2022-02-18 17:07:09 +01:00
|
|
|
// Allow using path magic variables to reduce boilerplate in stories.
|
2022-02-18 16:34:33 +01:00
|
|
|
config.node = {
|
|
|
|
__filename: true,
|
|
|
|
__dirname: true,
|
|
|
|
};
|
|
|
|
|
2021-04-24 10:32:24 +02:00
|
|
|
return config;
|
|
|
|
},
|
2021-12-23 05:21:23 +01:00
|
|
|
};
|