2021-06-02 03:54:00 +00:00
const webpackOverride = require ( '../webpack.config' ) ;
module . exports = {
2022-03-18 10:59:05 +00:00
core : {
builder : 'webpack5' ,
} ,
2021-06-02 03:54:00 +00:00
stories : [
// WooCommerce Admin / @woocommerce/components components
2022-04-27 21:54:54 +00:00
'../../../packages/js/components/src/**/stories/*.@(js|tsx)' ,
2021-06-02 03:54:00 +00:00
// WooCommerce Admin / @woocommerce/experimental components
2022-04-27 21:54:54 +00:00
'../../../packages/js/experimental/src/**/stories/*.@(js|tsx)' ,
'../../../plugins/woocommerce-admin/client/**/stories/*.js' ,
2021-06-02 03:54:00 +00:00
] ,
addons : [
'@storybook/addon-docs' ,
2022-03-18 11:45:14 +00:00
'@storybook/addon-controls' ,
// This package has been deprecated, in favor of @storybook/addon-controls
// However, it is still needed for the <Timeline /> story because changing the values with @storybook/addon-controls makes it crash. It seems that we cannot have jsx elements in props.
2021-06-02 03:54:00 +00:00
'@storybook/addon-knobs' ,
'@storybook/addon-viewport' ,
'@storybook/addon-a11y' ,
'@storybook/addon-actions' ,
'@storybook/addon-links' ,
] ,
typescript : {
reactDocgen : 'react-docgen-typescript' ,
} ,
webpackFinal : webpackOverride ,
2021-12-21 02:48:28 +00:00
previewHead : ( head ) => `
$ { head }
$ {
process . env . USE _RTL _STYLE === 'true'
? `
< link href = "experimental-css/style-rtl.css" rel = "stylesheet" / >
< link href = "component-css/style-rtl.css" rel = "stylesheet" / >
`
: `
< link href = "component-css/style.css" rel = "stylesheet" / >
< link href = "experimental-css/style.css" rel = "stylesheet" / >
`
}
< style >
/* Use system font, consistent with WordPress core (wp-admin) */
body {
font - family : - apple - system , BlinkMacSystemFont , 'Segoe UI' , Roboto ,
Oxygen - Sans , Ubuntu , Cantarell , 'Helvetica Neue' , sans - serif ;
}
< / s t y l e >
` ,
2021-06-02 03:54:00 +00:00
} ;