3 ms·
Using this should make WebPack work with LESS files. I'm no expert, but my understanding is that this says "for all files matching *.less, run them through the
by epicide 9y ago
Using this should make WebPack work with LESS files. I'm no expert, but my understanding is that this says "for all files matching *.less, run them through the CSS and LESS loaders, then use the Extract Text Plugin" (which pulls things into their own file; you'll need to configure it in the plugins).
{test: /\.less$/i, use: ExtractTextPlugin.extract(['css-loader', 'less-loader'])}
Edit: forgot a brace.
- hungerstrike 9y agoThanks! One thing - I'm not using WebPack directly and indeed, I have no access to the WebPack configuration because Create-React-App hides all of that from me. I can eject the app from Create-React-App and get a normal WebPack project, but I won't do that unless it's absolutely necessary because the huge community of Create-React-App devs are taking care of my config for me.
- ulucs 9y agocreate-react-app now uses some kind of extensible build scripts in form of react-scripts: webpack files which you can clone and modify and use without ejecting. here's one for less: https://www.npmjs.com/package/create-react-scripts-less https://www.npmjs.com/package/create-react-scripts-less also here are the official docs: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-a-css-preprocessor-sass-less-etc https://github.com/facebookincubator/create-react-app/blob/m...