An official website for Wait For You.
- Find
/node_modules/react-scripts/config/webpack.config.dev.js
; - Find
test: /\.css$/
, change it totest: /\.(?:le|c)ss$/
; - On the
use
array, after thecss-loader
object, add:Before this, run{ loader: require.resolve('less-loader'), options: { importLoaders: 1, }, }
npm i --save-dev less-loader less-watch-compiler
; - Your file should like this:
- Remember put your
less-loader
in the last of the array. - Apply the same setting to
/node_modules/react-scripts/config/webpack.config.prod.js
.
Reference