Ghost/apps/admin-x-settings/.storybook/main.tsx
Michael Barrett 2373a51ee4
Fixed storybook failing to load due @tryghost/nql usage (#18453)
no refs

storybook was failing to load due to `@tryghost/nql` usage and the
global `vite` config not being used
2023-10-03 16:49:05 +01:00

31 lines
791 B
TypeScript

import {resolve} from "path";
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
{
name: '@storybook/addon-styling',
},
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
// staticDirs: ['../public/fonts'],
async viteFinal(config, options) {
config.resolve.alias = {
crypto: require.resolve('rollup-plugin-node-builtins'),
// @TODO: Remove this when @tryghost/nql is updated
mingo: resolve(__dirname, '../../../node_modules/mingo/dist/mingo.js')
}
return config;
},
};
export default config;