Add SCSS config for old React project.
My React app was created by
create-react-app1.3.1 about five years ago.
I have to change the Node verstion to 8.9.4 every time when I want to run it locally.
The app has both
.scss files and
.css files which were compiled by relevant scss files. And in components, we imported the CSS file.
So I always want to find a way to import the SCSS file directly.
Today I have made it done.
As above config, I have to install the specific version for my old project.
Then add a rule for SCSS file in
Before you serve your project, don’t forget to add
.scss extension to loader exclusion list
Now you can import SCSS file in components, and run
start script to see the result.