README.md
2.82 KB
Install
npm install --save schema-utils
Usage
validateOptions
import validateOptions from 'schema-utils'
validateOptions('path/to/schema.json', options, 'Loader/Plugin Name')
Examples
Loader
import { getOptions } from 'loader-utils'
import validateOptions from 'schema-utils'
function loader (src, map) {
const options = getOptions(this) || {}
validateOptions('path/to/schema.json', options, 'Loader Name')
}
Plugin
import Tapable from 'tapable'
import validateOptions from 'schema-utils'
class Plugin extends Tapable {
constructor (options) {
validateOptions('path/to/schema.json', options, 'Plugin Name')
}
}
Maintainers
Juho Vepsäläinen | Joshua Wiens | Michael Ciniawsky |