Created by: hbj
Resolves #10336 (closed)
Changes done has been mainly deduced from the current implementation for SASS support. These include:
- Add opt-in support for LESS and LESS modules to webpack config in
react-scripts
with the possibility to pass options toless-loader
through a predefined file in the app root folder - Add documentation
- Add LESS support utils to
react-dev-utils
- Add tests to kitchensink test suite
Test plan:
- Manually test the end-to-end flow as described in the contribution document. The following features have been tested:
- Loading of local LESS stylesheets
- Loading of LESS stylesheets from
node_modules
- Loading of local LESS modules
- Generated CSS identifier of LESS modules (for index and non-index files)
- Helper error message output if
less
hasn't been installed
- Added unit tests and made sure they pass by running the corresponding test suites (
yarn e2e:docker --test-suite <test suite>
). Tests that are not passing don't seem to be related to this PR.
NOTE: The documentation contains a hint that the feature is available with
react-scripts@4.1.0
and higher. I included this temporarily as I don't know in which version this would be included, so this has to be updated once the information becomes available.