Package Exports
- tv4-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tv4-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tv4-loader
Webpack loader for validating json files against a schema file. Can be used in combination with json-loader.
Usage
module: {
preLoaders: [
{
test: path.join(__dirname, 'some-json-file.json'),
loader: 'tv4',
query: {
schema: path.join(__dirname, 'some-schema.json'),
}
}
],
loaders: [
{
test: /\.json$/,
loader: 'json'
}
]
}Query Parameters
schemas- Pre-register a schema for reference by other schema and synchronous validation. See tv4 for further informations.checkRecursive- Enable support for recursive schemas. See tv4 Documentation.banUnknownProperties- Throw an error for all unknown properties used in your json file. See tv4 Documentation.
Known Limitations
schemaneeds to be an absolute path to the schema file.
License
MIT