js-dxtools / webpack-validator

Validates your webpack config with Joi
MIT License
295 stars 29 forks source link

Catch duplicate entries #100

Open bebraw opened 8 years ago

bebraw commented 8 years ago

Webpack will fail rather messily if you have an entry configuration like this:

{
  app: path.join(__dirname, 'app'),
  style: [
    path.join(__dirname, 'app')
  ],

This leads to

Error: module cannot be added as entry point, because it's already in the bundle

It would be a very good idea to check against this as it can be hard to notice and it's one of those checks we can make.

It would be possible to do something similar against the source too but that would be far harder to pull off and goes beyond the scope of this issue.