Skip to content

Commit

Permalink
chore(packages/viewer): update Storybook configuration to use absolut…
Browse files Browse the repository at this point in the history
…e paths related to storybook dep update
  • Loading branch information
Schlomoh committed Nov 24, 2024
1 parent 051d4ab commit 72e376e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/viewer/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { dirname, join } from 'path';
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
addons: [
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-addon-deep-controls',
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('storybook-addon-deep-controls'),
],
framework: {
name: '@storybook/react-vite',
name: getAbsolutePath('@storybook/react-vite'),
options: {
builder: {
viteConfigPath: 'vite.config.ts',
Expand All @@ -22,3 +23,7 @@ export default config;
// To customize your Vite configuration you can use the viteFinal field.
// Check https://storybook.js.org/docs/react/builders/vite#configuration
// and https://nx.dev/recipes/storybook/custom-builder-configs

function getAbsolutePath(value: string): string {
return dirname(require.resolve(join(value, 'package.json')));
}

0 comments on commit 72e376e

Please sign in to comment.