js-dxtools / webpack-validator

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

Fails with extra section for stylus plugins #104

Closed bfin closed 8 years ago

bfin commented 8 years ago

Per https://github.com/shama/stylus-loader#stylus-plugins, stylus plugins are added to an extra 'stylus' section in the webpack config.

var rupture = require('rupture');
module: {
  loaders: [
    { test: /\.styl$/, loader: 'css-loader!stylus-loader' }
  ]
},
stylus: {
  use: [rupture()]
}

However, this fails validation with webpack-validator.

"stylus" is not allowed
jonathanglasmeyer commented 8 years ago

Hi! Please have a look at https://github.com/js-dxtools/webpack-validator/blob/master/README.md#schema as it exactly explains the solution for your problem. let me know if it works for you. 👍🏻

kentcdodds commented 8 years ago

This would be a great opportunity for a "plugin library" @bfin, if you're interested in creating something like that. Would basically require a module that has a peerDependency on webpack-validator and exports a schema for the stylus property.

bfin commented 8 years ago

@jonathanewerner Facepalm... Imagine that -- it's addressed right there in the readme! Thanks for being nice about it...grin.

@kentcdodds It'd probably be a good learning opportunity, but putting something like that together is currently beyond my abilities. Thanks for the suggestion, though

kentcdodds commented 8 years ago

@bfin, well, when you feel up to it you might benefit from my video series on the subject :-) http://kcd.im/write-oss