🔧(react) migrate storybook deployment to version 7
The package @storybook/storybook-deployer that seems to not directly work with Storybook 7 was expecting that command named "build-storybook" to exist. With the bin updates of Storybook 7 this bin does not longer exist, so I created a specfic script inside package.json that is named "build-storybook" too in order to make everything work. Also now that Storybook uses directly the local vite config, the fact that our config generates types was causing issues when building Storybook, that why we filter plugins in main.ts in order to remove "vite:dts".
This commit is contained in:
@@ -28,6 +28,19 @@ const config: StorybookConfig = {
|
||||
features: {
|
||||
storyStoreV7: true,
|
||||
},
|
||||
async viteFinal(config, options) {
|
||||
// We don't want the Storybook build to generate type definitions.
|
||||
const newConfig = {
|
||||
...config,
|
||||
plugins: config.plugins.filter((plugin) => {
|
||||
if (typeof plugin === "object") {
|
||||
return (plugin as any).name !== "vite:dts";
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
};
|
||||
return newConfig;
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"test-watch": "vitest",
|
||||
"coverage": "vitest run --coverage",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build",
|
||||
"deploy-storybook": "storybook-to-ghpages"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user