Created
June 25, 2023 16:44
-
-
Save konsalex/89775c4aa7b203df9c8a9a2443b5fca5 to your computer and use it in GitHub Desktop.
Storybook v7 Vite builder template setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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