I recently ejected my create-react-app because I need to load sass files. Unfortunately, create-react-app uses webpack 1. But, the current version of sass-loader includes a dependency on webpack 2. The support docs don't indicate the last sass-loader version that supports webpack 1. Does anyone know where I can find this info?
Asked
Active
Viewed 1,524 times
0
-
sass-loader at github – Adam Wolski Feb 23 '17 at 22:09
-
1and the on the release tab see the differences – juanecabellob Feb 24 '17 at 00:45
1 Answers
3
You'll need to use the webpack 1 branch of the loader: https://github.com/webpack-contrib/sass-loader/tree/archive/webpack-1
As shown in the documentation:
module.exports = {
...
module: {
loaders: [
{
test: /\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader"]
}
]
}
};
And then in your react app:
require("./file.scss")
In your npm install you'd do: npm i -S npm install sass-loader@4.1.1

Gabriel Kohen
- 4,166
- 4
- 31
- 46