kentcdodds / webpack-validator-DEPRECATED

Use this to save yourself some time when working on a webpack configuration.
MIT License
93 stars 8 forks source link

Update entry to not check for file existance #3

Closed kentcdodds closed 8 years ago

kentcdodds commented 8 years ago

From @sokra on gitter:

@kentcdodds Looks good. The entry validator should not check for file existance, as the string is resolved, which means you can omit extension, add query parameters, add loaders, use modules paths. This is disallowed when checking of file existance.

Basically doing this validation thing is going to be really hard because Webpack is amazingly flexible.

sapegin commented 8 years ago

Maybe to check only if it’s a filename (contains an extension)?

kentcdodds commented 8 years ago

Ah, that's not a bad idea. Problem is many people often omit the extension because they rely on the resolve.extensions (which we should probably account for here as well).

I want to err on the side of fewer errors I think, so unless we can think of a fool-proof way to know when to resort to checking for the file existing, I think I'll go for what you suggest.

sapegin commented 8 years ago

Yeah, resolve.extensions is a good idea also.