Skip to content

Commit 68b206a

Browse files
lexunbmatto
authored andcommitted
Add and configure sass-loader
1 parent 56b7397 commit 68b206a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/react-scripts/config/webpack.config.dev.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,19 @@ module.exports = function(publicPath) {
147147
// "style" loader turns CSS into JS modules that inject <style> tags.
148148
// In production, we use a plugin to extract that CSS to a file, but
149149
// in development "style" loader enables hot editing of CSS.
150-
// ZEAL: Add support for CSS Modules
150+
// ZEAL: Add support for CSS Modules and SASS
151151
{
152152
test: /\.css$/,
153153
loader: 'style!css?importLoaders=1&modules=1!postcss'
154154
},
155+
{
156+
test: /\.scss$/,
157+
loaders: [
158+
'style',
159+
'css?modules&importLoaders=1' +
160+
'&localIdentName=[path][local]__[hash:base64:5]!sass'
161+
]
162+
},
155163
// JSON is not enabled by default in Webpack but both Node and Browserify
156164
// allow it implicitly so we also enable it.
157165
{

packages/react-scripts/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@
5353
"http-proxy-middleware": "0.17.2",
5454
"jest": "16.0.2",
5555
"json-loader": "0.5.4",
56+
"node-sass": "^3.13.0",
5657
"object-assign": "4.1.0",
5758
"path-exists": "2.1.0",
5859
"postcss-loader": "1.0.0",
5960
"promise": "7.1.1",
6061
"react-dev-utils": "^0.3.0",
6162
"recursive-readdir": "2.1.0",
6263
"rimraf": "2.5.4",
64+
"sass-loader": "^4.0.2",
6365
"strip-ansi": "3.0.1",
6466
"style-loader": "0.13.1",
6567
"url-loader": "0.5.7",

0 commit comments

Comments
 (0)