Skip to content

Commit

Permalink
Use StorybookConfig type from @storybook/builder-vite
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjtc committed Sep 14, 2023
1 parent 3acfceb commit 6c5a6e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@storybook/builder-vite": "workspace:*",
"react": "^16.14.0",
"react-dom": "^16.8.0",
"typescript": "~4.9.3",
Expand Down
6 changes: 5 additions & 1 deletion code/addons/docs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { dedent } from 'ts-dedent';
import type { DocsOptions, Indexer, Options, StorybookConfig } from '@storybook/types';
import type { CsfPluginOptions } from '@storybook/csf-plugin';
import type { JSXOptions, CompileOptions } from '@storybook/mdx2-csf';
import type { StorybookConfigVite } from '@storybook/builder-vite';
import { global } from '@storybook/global';
import { loadCsf } from '@storybook/csf-tools';
import { logger } from '@storybook/node-logger';
Expand Down Expand Up @@ -176,7 +177,10 @@ export const addons: StorybookConfig['addons'] = [
require.resolve('@storybook/react-dom-shim/dist/preset'),
];

export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets, features }) => {
export const viteFinal: StorybookConfigVite['viteFinal'] = async (
config,
{ presets, features }
) => {
const { plugins = [] } = config;

plugins.push(await mdxPlugin({ presets, features }));
Expand Down

0 comments on commit 6c5a6e8

Please sign in to comment.