2020-01-30 20:59:14 +00:00
|
|
|
module.exports = {
|
|
|
|
stories: [
|
|
|
|
// WooCommerce Blocks stuff (anywhere in repo!)
|
2021-12-01 11:28:27 +00:00
|
|
|
'../assets/js/**/stories/*.@(js|jsx|ts|tsx)',
|
2021-12-21 17:08:57 +00:00
|
|
|
'../packages/**/stories/*.@(js|jsx|ts|tsx)',
|
2020-01-30 20:59:14 +00:00
|
|
|
],
|
|
|
|
addons: [
|
2021-12-01 11:28:27 +00:00
|
|
|
'@storybook/addon-essentials',
|
2020-01-30 20:59:14 +00:00
|
|
|
'@storybook/addon-a11y',
|
|
|
|
'@storybook/addon-links',
|
2021-12-01 11:28:27 +00:00
|
|
|
'storybook-addon-react-docgen',
|
2023-09-20 20:31:52 +00:00
|
|
|
'@storybook/addon-postcss',
|
2020-01-30 20:59:14 +00:00
|
|
|
],
|
2021-12-01 11:28:27 +00:00
|
|
|
features: {
|
|
|
|
babelModeV7: true,
|
2021-12-15 16:03:02 +00:00
|
|
|
emotionAlias: false,
|
2021-12-01 11:28:27 +00:00
|
|
|
},
|
2023-09-20 20:31:52 +00:00
|
|
|
core: {
|
|
|
|
builder: 'webpack5',
|
|
|
|
},
|
|
|
|
typescript: {
|
|
|
|
reactDocgen: 'react-docgen-typescript-plugin',
|
|
|
|
},
|
2022-10-31 11:23:22 +00:00
|
|
|
// webpackFinal field was added in following PR: https://github.com/woocommerce/woocommerce-blocks/pull/7514
|
|
|
|
// This fixes "storybook build issue" related to framer-motion library.
|
|
|
|
// Solution is from this commment: https://github.com/storybookjs/storybook/issues/16690#issuecomment-971579785
|
|
|
|
webpackFinal: async ( config ) => {
|
|
|
|
config.module.rules.push( {
|
|
|
|
test: /\.mjs$/,
|
|
|
|
include: /node_modules/,
|
|
|
|
type: 'javascript/auto',
|
|
|
|
} );
|
2023-10-26 10:33:04 +00:00
|
|
|
config.externals = [ 'react-dom/client' ];
|
2022-10-31 11:23:22 +00:00
|
|
|
return config;
|
|
|
|
},
|
2020-01-30 20:59:14 +00:00
|
|
|
};
|