Skip to content

Commit 33709d2

Browse files
committed
fix the sass loader, remove the css loader
1 parent 137cf4d commit 33709d2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

config-overrides.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
33
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
44

55
module.exports = function override (config, env) {
6-
// compile sass
6+
// remove the css loader to simplify things
7+
config.module.rules[1].oneOf = config.module.rules[1].oneOf.filter(function (l) {
8+
const test = l.test && l.test.toString()
9+
return test !== /\.css$/
10+
})
11+
// compile sass, this comes first and compresses css as well as loading sass/scss
712
// https://github.com/facebookincubator/create-react-app/issues/2498
8-
config.module.rules[1].oneOf.splice(config.module.rules[1].oneOf.length - 1, 0,
13+
config.module.rules[1].oneOf.splice(0, 0,
914
{
10-
test: /\.scss$/,
15+
test: /\.(sass|scss|css)$/,
1116
use: [
1217
'style-loader',
1318
'css-loader',

0 commit comments

Comments
 (0)