mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 15:36:50 -05:00
* reorg of storybook docs and add some new components * releaes notes * Update meta tags for Actual Budget Design System * Increase sidebar item font size from 14px to 16px
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
import type { StorybookConfig } from '@storybook/react-vite';
|
|
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
/**
|
|
* This function is used to resolve the absolute path of a package.
|
|
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
*/
|
|
function getAbsolutePath(value: string) {
|
|
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
|
}
|
|
const config: StorybookConfig = {
|
|
stories: [
|
|
'../src/Concepts/*.mdx',
|
|
'../src/Themes/*.mdx',
|
|
'../src/**/*.mdx',
|
|
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
|
|
],
|
|
addons: [
|
|
getAbsolutePath('@chromatic-com/storybook'),
|
|
getAbsolutePath('@storybook/addon-a11y'),
|
|
getAbsolutePath('@storybook/addon-docs'),
|
|
],
|
|
framework: getAbsolutePath('@storybook/react-vite'),
|
|
core: {
|
|
disableTelemetry: true,
|
|
},
|
|
staticDirs: ['./public'],
|
|
async viteFinal(config) {
|
|
const { mergeConfig } = await import('vite');
|
|
|
|
return mergeConfig(config, {
|
|
// Telling Vite how to resolve path aliases
|
|
plugins: [viteTsconfigPaths({ root: '../..' })],
|
|
esbuild: {
|
|
// Needed to handle JSX in .ts/.tsx files
|
|
jsx: 'automatic',
|
|
},
|
|
});
|
|
},
|
|
};
|
|
|
|
export default config;
|