gradio/js/storybook/main.ts
Hannah d92de491bf
Optimise Chromatic workflow (#6451)
* exclude draft prs

* add turbosnap

* pnpn lock

* add changeset

* fix pnpm

* fix storybook path

* fix path

* remove test logs

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-11-16 13:11:26 +01:00

40 lines
868 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/**/*.stories.@(js|jsx|ts|tsx|svelte|mdx)"
],
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;