I've seen many people import their main.css file in their main.js file, but this feels wrong to me. Why would I want my JavaScript to know or care about the CSS? What's wrong with including it in the webpack configuration entry instead?
Like so:
module.exports = {
...
entry: {
main: ['src/main.js', 'src/main.css']
},
...
};```
Also, is there any documentation explaining this? I haven't found any.
I've seen many people import their
main.css
file in theirmain.js
file, but this feels wrong to me. Why would I want my JavaScript to know or care about the CSS? What's wrong with including it in the webpack configuration entry instead?Like so: