Skip to content

Commit 8c9f46b

Browse files
author
sthzg
committed
Updated CSS loaders to support CSSModules #32
1 parent 20980d8 commit 8c9f46b

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

conf/webpack/Base.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,47 @@ class WebpackBaseConfig {
103103
]
104104
},
105105
{
106-
test: /\.(sass|scss)$/,
106+
test: /\.cssmodule\.(sass|scss)$/,
107+
loaders: [
108+
'style',
109+
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
110+
'sass'
111+
]
112+
},
113+
{
114+
test: /^.((?!cssmodule).)*\.(sass|scss)$/,
107115
loaders: [
108116
'style',
109117
'css',
110118
'sass'
111119
]
112120
},
113121
{
114-
test: /\.less$/,
122+
test: /\.cssmodule\.less$/,
123+
loaders: [
124+
'style',
125+
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
126+
'less'
127+
]
128+
},
129+
{
130+
test: /^.((?!cssmodule).)*\.less$/,
115131
loaders: [
116132
'style',
117133
'css',
118134
'less'
119135
]
120136
},
121137
{
122-
test: /\.styl$/,
138+
test: /\.cssmodule\.styl$/,
139+
loaders: [
140+
'style',
141+
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
142+
'stylus'
143+
]
144+
},
145+
{
146+
test: /^.((?!cssmodule).)*\.styl$/,
123147
loaders: [
124148
'style',
125149
'css',

0 commit comments

Comments
 (0)