js-dxtools / webpack-validator

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

`module.loaders` is now `module.rules` #136

Open vpanjganj opened 7 years ago

vpanjganj commented 7 years ago

Hi guys,

I keep getting [1] "loaders" is required and [2] "rules" is not allowed in my webpack 2 config. Can I use webpack-validator with latest webpack 2 release ?

kentcdodds commented 7 years ago

I was unaware of this change. This is hugely significant. Can you show me where this is documented?

kentcdodds commented 7 years ago

Found info about this property here: https://github.com/webpack/webpack/releases/tag/v2.1.0-beta.23 Looks like this is yet another way to do the same thing. It appears that loaders is not being deprecated.

So we need to support both. Would you like to [makeapullrequest.com](http://make a pull request.com)?

vpanjganj commented 7 years ago

Have a look at this see what you think https://github.com/webpack/webpack.js.org/blob/develop/content/how-to/upgrade-from-webpack-1.md#moduleloaders-is-now-modulerules

I had to remove webpack-validator for now to make mine work

vpanjganj commented 7 years ago

@kentcdodds I love to contribute, but I haven't worked with your codebase before and don't know how webpack-validator actually works. If time is not an issue, I will start working on this.

kentcdodds commented 7 years ago

The changes will need to happen in here (both tests and source). We definitely want to support Webpack 2 and 1 I think. If there's a way to detect which version the user is using that'd be awesome. It's likely you'll have to get a basic understanding of Joi, the validation library we use.

Good luck! And thank you!