Skip to content

Instantly share code, notes, and snippets.

@konsalex
Created June 25, 2023 16:44
Show Gist options
  • Save konsalex/89775c4aa7b203df9c8a9a2443b5fca5 to your computer and use it in GitHub Desktop.
Save konsalex/89775c4aa7b203df9c8a9a2443b5fca5 to your computer and use it in GitHub Desktop.
Storybook v7 Vite builder template setup
import { mergeConfig } from 'vite';
import path from 'path';
export default {
framework: '@storybook/react-vite',
features: {
storyStoreV7: true,
},
stories: [
'../stories/**/*.stories.mdx',
'../stories/**/*.stories.@(js|jsx|ts|tsx)',
],
docs: {
autodocs: true,
docsPage: true,
defaultName: 'Docs',
},
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
async viteFinal(config) {
return mergeConfig(config, {
build: {
rollupOptions: {
external: ['@storybook/window'],
},
},
resolve: {
alias: {
// 👈 ---- Here replace with the course's packages in order for aliased imports to work properly
'@table-nav/core/src': path.resolve(__dirname, '../../core/src'),
'@table-nav/react/src': path.resolve(__dirname, '../../react/src'),
},
},
});
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment