File tree Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ _.cssLoader = config.cssModules ?
13
13
'css-loader?-autoprefixer&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' :
14
14
'css-loader?-autoprefixer'
15
15
16
+ _ . cssProcessors = [
17
+ { loader : 'sass-loader?sourceMap' , test : / \. s c s s $ / } ,
18
+ { loader : 'less-loader?sourceMap' , test : / \. l e s s $ / } ,
19
+ { loader : 'stylus-loader?sourceMap' , test : / \. s t y l $ / } ,
20
+ { loader : 'sass-loader?indentedSyntax&sourceMap' , test : / \. s a s s $ / } ,
21
+ ]
22
+
16
23
_ . outputPath = config . electron ?
17
24
path . join ( __dirname , '../app/dist' ) :
18
25
path . join ( __dirname , '../dist' )
Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ base.plugins.push(
16
16
new FriendlyErrors ( )
17
17
)
18
18
19
- // push loader for .css file
20
- base . module . loaders . push (
21
- {
22
- test : / \. c s s $ / ,
23
- loaders : [ 'style-loader' , _ . cssLoader , 'postcss-loader' ]
24
- }
25
- )
19
+ // push loader for css files
20
+ _ . cssProcessors . forEach ( processor => {
21
+ base . module . loaders . push (
22
+ {
23
+ test : processor . test ,
24
+ loaders : [ 'style-loader' , _ . cssLoader , processor . loader ]
25
+ }
26
+ )
27
+ } )
26
28
27
29
module . exports = base
Original file line number Diff line number Diff line change @@ -47,12 +47,14 @@ base.plugins.push(
47
47
} )
48
48
)
49
49
50
- // extract css in standalone .css files
51
- base . module . loaders . push ( {
52
- test : / \. c s s $ / ,
53
- loader : ExtractTextPlugin . extract ( {
54
- loader : [ _ . cssLoader , 'postcss-loader' ] ,
55
- fallbackLoader : 'style-loader'
50
+ // extract css in standalone css files
51
+ _ . cssProcessors . forEach ( processor => {
52
+ base . module . loaders . push ( {
53
+ test : processor . test ,
54
+ loader : ExtractTextPlugin . extract ( {
55
+ loader : [ _ . cssLoader , processor . loader ] ,
56
+ fallbackLoader : 'style-loader'
57
+ } )
56
58
} )
57
59
} )
58
60
You can’t perform that action at this time.
0 commit comments