generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathmain.ts
25 lines (23 loc) · 803 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import type { StorybookConfig } from '@storybook/nextjs'
import { join, dirname } from 'path'
/**
* 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): any {
return dirname(require.resolve(join(value, 'package.json')))
}
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-interactions')
],
framework: {
name: getAbsolutePath('@storybook/nextjs'),
options: {}
}
}
export default config