mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
a2badf151e
* 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>
40 lines
871 B
TypeScript
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;
|