gradio/js/storybook/main.ts
Hannah a2badf151e
Migrate to Storybook 8 (#7743)
* migrate to storybook 8

* add changeset

* formatting

* test

* pnpm lock

* revert test

* update testing-library

* pass (and improve) failing tests

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-19 11:22:21 -07:00

40 lines
871 B
TypeScript

import type { StorybookConfig } from "@storybook/svelte-vite";
import { mergeConfig } from "vite";
import turbosnap from "vite-plugin-turbosnap";
const config: StorybookConfig = {
stories: [
"../../js/**/*.mdx",
"../../js/**/*.@(mdx|stories.@(js|jsx|ts|tsx|svelte))"
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-svelte-csf",
"@storybook/addon-a11y"
],
framework: {
name: "@storybook/svelte-vite",
options: {
builder: {
viteConfigPath: "js/storybook/vite.config.js"
}
}
},
staticDirs: ["./public"],
async viteFinal(config, { configType }) {
return mergeConfig(config, {
plugins:
configType === "PRODUCTION"
? [
turbosnap({
rootDir: `${process.cwd()}/js/storybook`
})
]
: []
});
}
};
export default config;