Hacker News new | past | comments | ask | show | jobs | submit login

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.




Thanks! 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.


create-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

also here are the official docs: https://github.com/facebookincubator/create-react-app/blob/m...




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: