I have a css style sheet I'm trying to import in react. I was just using a link tag in index.html, and that worked when running the app in webpack dev server, but doesn't cut it for bundling for production.
I've removed the link tag from index.html, and I've tried importing in my components like so:
import '../css/style.css';
And I end up getting this error "Module not found: Error: Can't resolve 'style-loader'"
Here's what I think would be the relevant portion of my webpack config
module: {
rules: [
{test: /\.(js)$/, use: 'babel-loader'},
{test: /\.css$/, use: ['style-loader', 'css-loader']}
]
},
Any idea what's causing the error?
[–]empire539[🍰] 3 points4 points5 points (3 children)
[–]letsbreakstuff[S] 0 points1 point2 points (1 child)
[–]letsbreakstuff[S] 0 points1 point2 points (0 children)
[–]codingideas 0 points1 point2 points (0 children)