File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' )
2
+ const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
3
+
1
4
// import '../src/styles/reset.css'
2
5
3
6
module . exports = {
4
7
core : {
5
- builder : 'webpack5 ' ,
8
+ builder : 'webpack4 ' ,
6
9
} ,
7
10
stories : [ '../stories/Temp.stories.tsx' , '../stories/Error.stories.tsx' ] ,
8
11
addons : [ '@storybook/addon-actions' , '@storybook/addon-knobs' , '@storybook/addon-links' ] ,
9
12
babel : async ( options ) => ( {
10
13
...options ,
11
14
presets : [ ...options . presets , '@emotion/babel-preset-css-prop' , '@babel/preset-react' ] ,
15
+ plugins : [
16
+ [
17
+ 'import' ,
18
+ {
19
+ libraryName : '@alifd/next' ,
20
+ style : true ,
21
+ } ,
22
+ ] ,
23
+ ] ,
12
24
} ) ,
25
+ webpackFinal : ( config ) => {
26
+ config . module . rules . push ( {
27
+ test : / \. s c s s $ / ,
28
+ use : [ 'style-loader' , 'css-loader' , 'sass-loader' ] ,
29
+ } )
30
+ config . module . rules . push ( {
31
+ test : / \. ( t s | t s x ) $ / ,
32
+ loader : require . resolve ( 'babel-loader' ) ,
33
+ } )
34
+
35
+ config . plugins . push ( new MiniCssExtractPlugin ( { filename : '[name].css' } ) )
36
+ config . resolve . extensions . push ( '.ts' , '.tsx' )
37
+
38
+ config . resolve . modules = [ 'node_modules' , path . resolve ( __dirname , '../src' ) ]
39
+
40
+ return config
41
+ } ,
13
42
}
You can’t perform that action at this time.
0 commit comments