Skip to content

Commit

Permalink
feat: import all stories #137
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Feb 7, 2024
1 parent 9f9383c commit 8a80823
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { resolve } from 'node:path'
import type { StorybookConfig } from '@storybook/vue3-vite'

const config: StorybookConfig = {
stories: [
'../stories/**/*.mdx',
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../components/Fields/DateRange.stories.@(js|jsx|mjs|ts|tsx)',
'../components/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
'@storybook/addon-links',
Expand All @@ -18,5 +17,21 @@ const config: StorybookConfig = {
docs: {
autodocs: 'tag',
},
viteFinal: async (config) => {
if (config.resolve) {
config.resolve.alias = {
...config.resolve.alias,
'~': resolve(__dirname, '../'),
// Bad pratice to import this way, we should take benefit of auto-imports
'#app': resolve(__dirname, '../node_modules/nuxt/dist/app'),
'#head': resolve(__dirname, '../node_modules/nuxt/dist/head/runtime'),
'#build': resolve(__dirname, '../.nuxt'),
'#imports': resolve(__dirname, '../.nuxt/imports'),
'#image': resolve(__dirname, '../node_modules/@nuxt/image-edge/dist/runtime'),
}
}

return config
},
}
export default config

0 comments on commit 8a80823

Please sign in to comment.