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)' ,
2023-08-22 09:58:33 +00:00
// WooCommerce Admin / @woocommerce/onboarding components
'../../../packages/js/onboarding/src/**/stories/*.@(js|tsx)' ,
2024-09-03 14:09:54 +00:00
'../../../packages/js/product-editor/src/**/*.stories.@(js|tsx)' ,
2023-07-24 12:34:38 +00:00
'../../../plugins/woocommerce-admin/client/**/stories/*.@(js|tsx)' ,
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' ,
} ,
2023-07-24 12:34:38 +00:00
staticDirs : [
{
from : '../../../plugins/woocommerce-admin/client' ,
to : 'main/plugins/woocommerce-admin/client' ,
} ,
] ,
2021-06-02 03:54:00 +00:00
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" / >
2023-08-22 09:58:33 +00:00
< link href = "onboarding-css/style-rtl.css" rel = "stylesheet" / >
2023-12-19 16:09:30 +00:00
< link href = "product-editor-css/style-rtl.css" rel = "stylesheet" / >
2023-07-24 12:34:38 +00:00
< link href = "app-css/style-rtl.css" rel = "stylesheet" / >
2021-12-21 02:48:28 +00:00
`
: `
< link href = "component-css/style.css" rel = "stylesheet" / >
< link href = "experimental-css/style.css" rel = "stylesheet" / >
2023-08-22 09:58:33 +00:00
< link href = "onboarding-css/style.css" rel = "stylesheet" / >
2023-12-19 16:09:30 +00:00
< link href = "product-editor-css/style.css" rel = "stylesheet" / >
2023-07-24 12:34:38 +00:00
< link href = "app-css/style.css" rel = "stylesheet" / >
2021-12-21 02:48:28 +00:00
`
}
< 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 >
` ,
2023-07-24 12:34:38 +00:00
previewBody : ( body ) => `
< div id = "wpwrap" >
2023-09-15 20:06:42 +00:00
< div class = "woocommerce-layout woocommerce-admin-page" >
2023-07-24 12:34:38 +00:00
$ { body }
` ,
2021-06-02 03:54:00 +00:00
} ;