Webpack 2 comes with the new resolve setting and when I try to modify the setting in config, as follows, webpackValidator throws an error saying
"Modules" is not allowed"
const config = webpackValidator({
context: resolve('src'),
entry: './app.js',
output: {
filename: 'bundle.js',
path: resolve('dist'),
publicPath: '/dist/',
pathinfo: ifNotProd(),
},
devtool: ifProd('source-map', 'eval'),
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.js'],
modules: [
resolve(__dirname, 'src'),
resolve(__dirname, 'node_modules')
]
},
plugins: [
new DashboardPlugin()
]
})
As mentioned on the webpack-validator project's readme (npm & github), you should seriously consider giving up the use of this package...
I had the same issue and finally gave up its use : Webpack 2 introduced breaking changes that surely won't be followed by the webpack-validator project. The new built-in validation for configuration in Webpack 2 is now good enough.
By the way, your config may need a few improvements :
module.loaders
becomesmodule.rules
module.loaders.loaders
becomesmodule.rules.use
resolveLoader.moduleTemplates
property).