Skip to content

Commit 72e376e

Browse files
committed
chore(packages/viewer): update Storybook configuration to use absolute paths related to storybook dep update
1 parent 051d4ab commit 72e376e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/viewer/.storybook/main.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import { dirname, join } from 'path';
12
import type { StorybookConfig } from '@storybook/react-vite';
23

34
const config: StorybookConfig = {
45
stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
56
addons: [
6-
'@storybook/addon-essentials',
7-
'@storybook/addon-interactions',
8-
'storybook-addon-deep-controls',
7+
getAbsolutePath('@storybook/addon-essentials'),
8+
getAbsolutePath('@storybook/addon-interactions'),
9+
getAbsolutePath('storybook-addon-deep-controls'),
910
],
1011
framework: {
11-
name: '@storybook/react-vite',
12+
name: getAbsolutePath('@storybook/react-vite'),
1213
options: {
1314
builder: {
1415
viteConfigPath: 'vite.config.ts',
@@ -22,3 +23,7 @@ export default config;
2223
// To customize your Vite configuration you can use the viteFinal field.
2324
// Check https://storybook.js.org/docs/react/builders/vite#configuration
2425
// and https://nx.dev/recipes/storybook/custom-builder-configs
26+
27+
function getAbsolutePath(value: string): string {
28+
return dirname(require.resolve(join(value, 'package.json')));
29+
}

0 commit comments

Comments
 (0)