timarney / react-app-rewired

Override create-react-app webpack configs without ejecting
MIT License
9.76k stars 425 forks source link

scss solution #654

Open wingedearth opened 5 months ago

wingedearth commented 5 months ago

react-app-rewired-scss doesn't appear to be compatible with react-app-rewired v2.2.1. I get a dependency error when attempting to resolve. If I try to force the install of react-app-rewired-scss I get a gyp error.

Does react-app-rewired have a solution for loading SCSS?

dawnmist commented 2 months ago

There was a major update to webpack from version 4 to version 5 when create-react-app upgraded to react-scripts version 2.0 - all older plugins for react-app-rewired that worked with webpack 4 became incompatible with version 5 of webpack.

I cannot find react-app-rewired-scss, but I can find react-app-rewire-scss - the mod with the name without the "d" on rewire is one of the older webpack 4 mods, so it is not compatible with react-app-rewired version 2+ and not compatible with webpack 5+.

If you're using create-react-app with react-scripts version 2+, scss is supported by create-react-app itself - you don't need react-app-rewired for scss compatibility. See: https://create-react-app.dev/docs/adding-a-sass-stylesheet.

If you're using a very very old version of create-react-app with react-scripts version 1, you'll need to be using react-app-rewired version 1.6 for it to be compatible with the very old version of create-react-app.