Importing css


#1

I’m building a small app with electron-prebuilt-compile and I’m using React as the front end framework, but I get an error when I try loading css files in my component files.

import './styles/app.css';

Uncaught Error: Couldn’t find a compiler for ~path/src/styles/app.css

I can find several resources that show how to install css-loaders on webpack but I’m trying to avoid webpack, since it serves no real purpose for me. Does anyone know how to make this work?


#2

Does it works in browser? You should do it same way, I don’t know react but importing css like this is sick.


#3

It does if I use webpack but the recommendation is to not use webpack with electron. I’ve tried several babel packages but haven’t been able to get it to work without webpack.