You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
997 B
39 lines
997 B
import { resolve } from 'node:path'; |
|
|
|
import type { StorybookConfig } from '@storybook/react-vite'; |
|
|
|
const config: StorybookConfig = { |
|
stories: ['../app/javascript/**/*.stories.@(js|jsx|mjs|ts|tsx)'], |
|
addons: [ |
|
'@storybook/addon-docs', |
|
'@storybook/addon-a11y', |
|
'@storybook/addon-vitest', |
|
], |
|
framework: { |
|
name: '@storybook/react-vite', |
|
options: {}, |
|
}, |
|
staticDirs: [ |
|
'./static', |
|
// We need to manually specify the assets because of the symlink in public/sw.js |
|
...[ |
|
'avatars', |
|
'emoji', |
|
'headers', |
|
'sounds', |
|
'badge.png', |
|
'loading.gif', |
|
'loading.png', |
|
'oops.gif', |
|
'oops.png', |
|
].map((path) => ({ from: `../public/${path}`, to: `/${path}` })), |
|
], |
|
viteFinal(config) { |
|
// For an unknown reason, Storybook does not use the root |
|
// from the Vite config so we need to set it manually. |
|
config.root = resolve(__dirname, '../app/javascript'); |
|
return config; |
|
}, |
|
}; |
|
|
|
export default config;
|
|
|