Skip to content

Instantly share code, notes, and snippets.

@mihkeleidast
Last active November 30, 2022 18:43
Show Gist options
  • Save mihkeleidast/af2e01ee4672804ed79d903a1093a7ab to your computer and use it in GitHub Desktop.
Save mihkeleidast/af2e01ee4672804ed79d903a1093a7ab to your computer and use it in GitHub Desktop.
.storybook/main.ts after migration
import type { StorybookViteConfig } from '@storybook/builder-vite';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import { mergeConfig } from 'vite';
const config: StorybookViteConfig = {
stories: ['../**/*.stories.mdx'],
addons: [
'./theme-addon/preset.ts',
'@storybook/addon-actions',
'@storybook/addon-a11y',
'@storybook/addon-measure',
'@storybook/addon-outline',
{
name: '@storybook/addon-docs',
options: {
transcludeMarkdown: true,
},
},
'@storybook/addon-controls',
],
framework: '@storybook/react',
staticDirs: ['./static', { from: '../../design-tokens/build/figma', to: '/tokens' }],
typescript: {
check: true,
checkOptions: {
// hide type errors in third party types in node_modules
reportFiles: ['src/**/*.{ts,tsx}'],
},
},
core: {
builder: '@storybook/builder-vite',
},
features: {
storyStoreV7: true,
},
async viteFinal(config) {
return mergeConfig(config, {
base: './',
plugins: [vanillaExtractPlugin()],
});
},
};
export default config;
import type { StorybookViteConfig } from '@storybook/builder-vite';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import { mergeConfig } from 'vite';
const config: StorybookViteConfig = {
stories: ['../**/*.stories.@(ts|tsx|js|jsx|mdx)'],
addons: ['./theme-addon/preset.ts', '@storybook/addon-actions', '@storybook/addon-a11y', '@storybook/addon-measure', '@storybook/addon-outline', {
name: '@storybook/addon-docs',
options: {
transcludeMarkdown: true
}
}, '@storybook/addon-controls'],
framework: '@storybook/react',
staticDirs: ['./static', {
from: '../../design-tokens/build/figma',
to: '/tokens'
}],
typescript: {
check: true,
checkOptions: {
// hide type errors in third party types in node_modules
reportFiles: ['src/**/*.{ts,tsx}']
}
},
core: {
builder: '@storybook/builder-vite'
},
features: {
storyStoreV7: true
},
async viteFinal(config) {
return mergeConfig(config, {
base: './',
plugins: [vanillaExtractPlugin()]
});
}
};
export default config;
export const framework = '@storybook/react';
export const framework = {
name: '@storybook/react-webpack5',
options: {}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment