I don't have a huge website, but I still want to maintain css separate from my js files.
My folder structure:
static
css
style.css
js
landing.js
In my landing.js file, I have: import styles from '../css/style.css';
With the above mentioned setup, I am getting this error:
react-dom.production.min.js:12 Uncaught Error: Minified React error #130;
Am I doing something wrong? If I must use something like webpack to avoid getting minified errors, why is that the case? Why can't I just use simple CSS?
Note: I'm not using JSX
webpackconfig?importstatement that you have used is part of theES6spec andES6is not (yet) fully supported in all browsers. So you'll need to usebabelto compile your code which browser can run. Usingwebpackwill make it easier to add plugins likebabel, and then for loading the CSS files you can usecss-loaderandstyle-loader.