Releases: js-dxtools/webpack-validator
Releases · js-dxtools/webpack-validator
v2.0.1
v2.0.0
<a name"2.0.0">
2.0.0 (2016-05-20)
Features
- add "rules" concept
resolve.root
name-clash detection with node_modules package names (closes #79)- file paths are now checked for existence on disk
Breaking Changes
validate()
now takes only two arguments:validate(yourConfig, optionsObject)
. The schema which could be passed as second argument can now be supplied via propertyschema
on the options object which is now the second argument. The now preferred way to supply extra properties to the schema is supplying a a Joi.object via the options propertyschemaExtension
, that just contains the properties you want to add (see README under "Customizing").- The schema used by this library is not exported anymore, as we now dynamically create the schema by parameterizing it with "rules" which toggle / modify parts of the schema (have a look at
src/index.js
to learn more).
(30e02407)
Upgrade Guide
You only need to update your code if you customized the schema and/or specified options. If you only used webpack-validator with it's default configuration (validate(yourConfig)
), you don't need to change anything.
Otherwise check out this diff to get the gist of the changes:
const validate = require('webpack-validator')
- const schema = require('webpack-validator').schema // schema is not exported anymore
- const Joi = require('joi') // relied on npm3 putting this dep into your top level node_modules
+ const Joi = require('webpack-validator').Joi // now exported by this library
// Instead of "concatting" the internal schema with your extension schema by yourself,
// you now just supply the extension schema
- const yourSchema = schema.concat(Joi.object({
- eslint: Joi.any()
- }))
+ const yourSchemaExtension = Joi.object({
+ eslint: Joi.any()
+ })
const config = { /* ... your webpack config */ }
// Instead of supplying the whole concatted schema as your second argument
// and additional options as your third argument,
// you now supply the schemaExtension *and* additional options on the second argument.
- module.exports = validate(config, yourSchema, { quiet: true })
+ module.exports = validate(config, { schemaExtension: yourSchemaExtension, quiet: true })