@@ -40,30 +40,29 @@ module.exports = {
40
40
test : / \. j s $ / ,
41
41
loader : 'source-map-loader' ,
42
42
} ,
43
- // load styles from node_modules but leave them un-touched
44
- // this is important for codemirror and ol
43
+ // We use css modules for our own code, which uses .module.css as naming convention.
45
44
{
46
- test : / \. c s s $ / ,
47
- include : path . resolve ( __dirname , 'node_modules' ) ,
48
- exclude : path . resolve ( __dirname , 'src' ) ,
49
- use : [ { loader : 'style-loader' } , { loader : 'css-loader' } ] ,
50
- } ,
51
- // load styles from sources and apply css modules to them
52
- {
53
- test : / \. c s s $ / ,
45
+ test : / \. m o d u l e \. c s s $ / ,
54
46
exclude : path . resolve ( __dirname , 'node_modules' ) ,
55
47
use : [
56
48
{ loader : 'style-loader' } ,
57
49
{
58
50
loader : 'css-loader' ,
59
51
options : {
60
52
modules : {
61
- auto : resourcePath => resourcePath . endsWith ( '.module.css' ) ,
53
+ localIdentName : '[path][name]__[local]' ,
62
54
} ,
63
55
} ,
64
56
} ,
65
57
] ,
66
58
} ,
59
+ // All other css files are simply processed without modules.
60
+ // We use these for some 3rd party dependencies like ol and codemirror.
61
+ {
62
+ test : / \. c s s $ / ,
63
+ exclude : / \. m o d u l e \. c s s $ / ,
64
+ use : [ { loader : 'style-loader' } , { loader : 'css-loader' } ] ,
65
+ } ,
67
66
// this loader inlines svg images as react components
68
67
{
69
68
test : / \. s v g $ / ,
0 commit comments