AFFiNE/packages/component/.storybook/vite.config.ts
2023-02-14 11:18:43 +08:00

22 lines
593 B
TypeScript

import type { StorybookConfig } from '@storybook/react-vite';
import { mergeConfig } from 'vite';
import path from 'node:path';
import { fileURLToPath } from 'url';
const config: Pick<StorybookConfig, 'viteFinal'> = {
async viteFinal(config, { configType }) {
return mergeConfig(config, {
resolve: {
alias: {
'@': path.resolve(fileURLToPath(new URL('../src', import.meta.url))),
'@affine/i18n': path.resolve(
fileURLToPath(new URL('../../i18n/src', import.meta.url))
),
},
},
});
},
};
export default config;