diff --git a/.storybook/main.ts b/.storybook/main.ts index 3ed39da64..9626bb452 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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', @@ -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