-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
36 lines (34 loc) · 921 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
26
27
28
29
30
31
32
33
34
35
36
import type { StorybookConfig } from '@storybook/nextjs'
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
webpackFinal: async (config) => {
config.module = config.module || {}
config.module.rules = config.module.rules || []
const imageRule = config.module.rules.find((rule) =>
// @ts-ignore
rule?.['test']?.test('.svg'),
)
if (imageRule) {
// @ts-ignore
imageRule['exclude'] = /\.svg$/
}
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
return config
},
}
export default config