Fix storybook build (#51037)

* Fix storybook build

* Ignore storybook from version pinning

---------

Co-authored-by: Sam Seay <samueljseay@gmail.com>
This commit is contained in:
Luigi Teschio 2024-08-29 12:50:35 +02:00 committed by GitHub
parent ad94888ce3
commit 4ab886ada0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 751 additions and 449 deletions

View File

@ -88,7 +88,8 @@
"webpack*"
],
"packages": [
"@woocommerce/block-library"
"@woocommerce/block-library",
"@woocommerce/storybook"
],
"isIgnored": true
},

File diff suppressed because it is too large Load Diff

View File

@ -46,9 +46,8 @@
"@storybook/react": "6.5.17-alpha.0",
"@storybook/theming": "6.5.17-alpha.0",
"@woocommerce/eslint-plugin": "workspace:*",
"react": "^17.0.2",
"react18": "npm:react@^18.3.0",
"react-dom": "^17.0.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"wireit": "0.14.3"

View File

@ -45,7 +45,14 @@ module.exports = ( storybookConfig ) => {
// We need to use react 18 for the storybook since some dependencies are not compatible with react 17
// Once we upgrade react to 18 in repo, we can remove this alias
storybookConfig.resolve.alias.react = require.resolve( 'react18' );
storybookConfig.resolve.alias.react = path.resolve(
__dirname,
'./node_modules/react'
);
storybookConfig.resolve.alias[ 'react-dom' ] = path.resolve(
__dirname,
'./node_modules/react-dom'
);
storybookConfig.resolve.modules = [
path.join( __dirname, '../../plugins/woocommerce-admin/client' ),