Skip to content

Commit e83d27d

Browse files
JulienAuvoBekiboo
andauthored
fix: return getAbsolutePath function to storybook (#58)
Co-authored-by: Bekiboo <[email protected]>
1 parent b3f18de commit e83d27d

File tree

2 files changed

+181
-93
lines changed

2 files changed

+181
-93
lines changed
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import type { StorybookConfig } from '@storybook/sveltekit'
2+
import { join, dirname } from 'path'
3+
4+
function getAbsolutePath(value: string): any {
5+
return dirname(require.resolve(join(value, 'package.json')))
6+
}
27

38
const config: StorybookConfig = {
49
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|ts)'],
510
addons: [
6-
7-
getAbsolutePath("@storybook/addon-essentials"),
8-
getAbsolutePath("@chromatic-com/storybook"),
9-
getAbsolutePath("@storybook/experimental-addon-test"),
11+
getAbsolutePath('@storybook/addon-essentials'),
12+
getAbsolutePath('@chromatic-com/storybook'),
13+
getAbsolutePath('@storybook/experimental-addon-test'),
1014
],
1115
framework: {
1216
name: '@storybook/sveltekit',
1317
options: {},
1418
},
1519

16-
staticDirs: ["../static"],
17-
};
18-
export default config;
20+
staticDirs: ['../static'],
21+
}
22+
export default config

0 commit comments

Comments
 (0)