vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.7k stars 4.39k forks source link

Question: Why import CSS in main.js instead of including it in an entry? #1436

Closed NoBrainer closed 6 years ago

NoBrainer commented 6 years ago

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.
NoBrainer commented 6 years ago

Wrong repository. Sorry about that.