Created by: Fabianopb
Opt-in support for SASS and CSS-modules using SASS files added, using both .scss and .sass extensions. This PR:
- Installs
sass-loader
in the react-scripts package - Adds webpack configuration to allow importing scss/sass directly into components during development, supporting also the use of CSS-modules
- Adds webpack configuration for bundling scss/sass files into the optimized production build, supporting also the use of CSS-modules
- CSS-modules in SASS are supported in a similar way than using purely CSS, which in this case is naming SASS files as .module.scss or .module.sass.
~No automated test just yet (coming in a couple days)! However I've manually tried the e2e flow using both scss and sass extensions, with or without modules, and it worked just fine.~~
edit:
This PR depends on https://github.com/webpack-contrib/sass-loader/pull/533 to work properly.
I'll be happy to get comments! :)
edit: @andriijas mentioned that we should use react-dev-utils/getCSSModuleLocalIdent when https://github.com/facebook/create-react-app/pull/4192 is merged, for the . localIdentName