1+ const path = require ( 'path' ) ;
2+
3+ module . exports = {
4+ stories : [
5+ '../src/**/*.stories.mdx' ,
6+ '../src/**/*.stories.@(js|jsx|ts|tsx)'
7+ ] ,
8+ addons : [
9+ '@storybook/addon-actions' ,
10+ '@storybook/addon-docs' ,
11+ '@storybook/addon-essentials' ,
12+ '@storybook/addon-interactions' ,
13+ '@storybook/addon-links' ,
14+ ''
15+ ] ,
16+ staticDirs : [ '../public/assets' ] ,
17+ framework : "@storybook/react" ,
18+ core : {
19+ "builder" : "webpack5"
20+ } ,
21+ typescript : {
22+ check : false ,
23+ checkOptions : { } ,
24+ reactDocgen : "react-docgen-typescript" ,
25+ reactDocgenTypescriptOptions : {
26+ shouldExtractLiteralValuesFromEnum : true ,
27+ propFilter : ( prop ) => ( prop . parent ? ! / n o d e _ m o d u l e s / . test ( prop . parent . fileName ) : true ) ,
28+ } ,
29+ } ,
30+ webpackFinal : async ( config , { configType } ) => {
31+ // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
32+ // You can change the configuration based on that.
33+ // 'PRODUCTION' is used when building the static version of storybook.
34+
35+ const fileLoaderRule = config . module . rules . find ( rule => rule . test && rule . test . test ( '.svg' ) ) ;
36+ fileLoaderRule . exclude = / \. s v g $ / ;
37+
38+ config . module . rules . push (
39+ {
40+ test : / \. s [ c a ] s s | c s s $ / ,
41+ use : [ 'style-loader' , 'css-loader' , 'resolve-url-loader' , 'sass-loader' ] ,
42+ include : path . resolve ( __dirname , '../' )
43+ } ,
44+ {
45+ test : / \. s v g $ / ,
46+ use : [ '@svgr/webpack' , 'file-loader' , 'url-loader' ] ,
47+ include : path . resolve ( __dirname , '../' )
48+ }
49+ ) ;
50+
51+ config . resolve . fallback = {
52+ http : false
53+ }
54+
55+ return config ;
56+ } ,
57+ } ;
0 commit comments