1
1
const path = require ( 'path' ) ;
2
2
const webpack = require ( 'webpack' ) ;
3
3
4
- module . exports = ( storybookBaseConfig , configType ) => {
5
- const DEV = configType === 'DEVELOPMENT' ;
4
+ module . exports = ( { config , mode } ) => {
5
+ const DEV = mode === 'DEVELOPMENT' ;
6
6
7
7
const libDirectory = path . resolve ( __dirname , '../../' ) ;
8
8
9
- storybookBaseConfig . module . rules . push ( {
9
+ config . module . rules . push ( {
10
10
test : / \. j s $ / ,
11
11
include : [
12
12
path . resolve ( libDirectory , 'src' ) ,
13
+ path . resolve ( libDirectory , 'docs' ) ,
13
14
] ,
14
15
use : {
15
16
loader : 'babel-loader' ,
@@ -21,19 +22,19 @@ module.exports = (storybookBaseConfig, configType) => {
21
22
}
22
23
} ) ;
23
24
24
- storybookBaseConfig . plugins . push (
25
+ config . plugins . push (
25
26
new webpack . DefinePlugin ( {
26
27
'process.env.NODE_ENV' : JSON . stringify ( process . env . NODE_ENV || 'development' ) ,
27
28
'process.env.__REACT_NATIVE_DEBUG_ENABLED__' : DEV
28
29
} )
29
30
) ;
30
31
31
- storybookBaseConfig . resolve . extensions = [ '.web.js' , '.js' , '.json' , '.web.jsx' , '.jsx' ] ;
32
+ config . resolve . extensions = [ '.web.js' , '.js' , '.json' , '.web.jsx' , '.jsx' ] ;
32
33
33
- storybookBaseConfig . resolve . alias = {
34
+ config . resolve . alias = {
34
35
'react-native$' : 'react-native-web' ,
35
36
'lottie-react-native' : path . join ( __dirname , '../../src/' )
36
37
} ;
37
38
38
- return storybookBaseConfig ;
39
+ return config ;
39
40
} ;
0 commit comments