File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,20 @@ module.exports = {
220220 } ,
221221 ] ,
222222 } ,
223+ {
224+ test : / \. s c s s $ / ,
225+ use : [
226+ 'style-loader' ,
227+ // Using source maps breaks urls in the CSS loader
228+ // https://github.com/webpack/css-loader/issues/232
229+ // This comment solves it, but breaks testing from a local network
230+ // https://github.com/webpack/css-loader/issues/232#issuecomment-240449998
231+ // 'css-loader?sourceMap',
232+ 'css-loader?importLoaders=1&modules&localIdentName=[path]___[name]__[local]___[hash:base64:5]' ,
233+ 'postcss-loader' ,
234+ 'sass-loader' ,
235+ ] ,
236+ } ,
223237 // "file" loader makes sure those assets get served by WebpackDevServer.
224238 // When you `import` an asset, you get its (virtual) filename.
225239 // In production, they would get copied to the `build` folder.
Original file line number Diff line number Diff line change @@ -235,6 +235,13 @@ module.exports = {
235235 ) ,
236236 // Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
237237 } ,
238+ {
239+ test : / \. s c s s $ / ,
240+ loader : ExtractTextPlugin . extract ( {
241+ fallbackLoader : 'style-loader' ,
242+ loader : 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader!sass-loader' ,
243+ } ) ,
244+ } ,
238245 // "file" loader makes sure assets end up in the `build` folder.
239246 // When you `import` an asset, you get its filename.
240247 // This loader don't uses a "test" so it will catch all modules
Original file line number Diff line number Diff line change 4444 "fs-extra" : " 3.0.1" ,
4545 "html-webpack-plugin" : " 2.29.0" ,
4646 "jest" : " 20.0.4" ,
47+ "node-sass" : " ^4.5.3" ,
4748 "object-assign" : " 4.1.1" ,
4849 "postcss-flexbugs-fixes" : " 3.0.0" ,
4950 "postcss-loader" : " 2.0.6" ,
5051 "promise" : " 7.1.1" ,
5152 "react-dev-utils" : " ^3.0.2" ,
5253 "react-error-overlay" : " ^1.0.9" ,
54+ "sass-loader" : " ^6.0.6" ,
5355 "style-loader" : " 0.18.2" ,
5456 "sw-precache-webpack-plugin" : " 0.11.3" ,
5557 "url-loader" : " 0.5.9" ,
You can’t perform that action at this time.
0 commit comments