Izmjenjena struktura, dodan backand

This commit is contained in:
GotPPay
2017-10-16 11:19:46 +02:00
parent 1ec88afacb
commit 048e32c4aa
37153 changed files with 2975854 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
module.exports = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"allChunks": { "type": "boolean"},
"disable": { "type": "boolean" },
"omit": { "type": "boolean" },
"remove": { "type": "boolean" },
"fallback": { "type": ["string", "array", "object"] },
"filename": { "type": "string" },
"use": { "type": ["string", "array", "object"] },
"publicPath": { "type": "string" },
// deprecated
"fallbackLoader": { "type": ["string", "array", "object"] },
"loader": { "type": ["string", "array", "object"] }
}
};

View File

@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"allChunks": {
"description": "",
"type": "boolean"
},
"disable": {
"description": "",
"type": "boolean"
},
"fallback": {
"description": "A loader that webpack can fall back to if the original one fails.",
"modes": {
"type": "string",
"type": "object",
"type": "array"
}
},
"filename": {
"description": "The filename and path that ExtractTextPlugin will extract to",
"modes": {
"type": "string",
"type": "function"
}
},
"ignoreOrder": {
"description": "Ignore dependency order (useful for CSS Modules)",
"type": "boolean"
},
"loader": {
"description": "The loader that ExtractTextPlugin will attempt to load through.",
"modes": {
"type": "string",
"type": "object",
"type": "array"
}
},
"publicPath": {
"description": "",
"type": "string"
}
}
}

View File

@@ -0,0 +1,13 @@
var Ajv = require('ajv');
var ajv = new Ajv({allErrors: true});
module.exports = function validate(schema, data) {
var ajv = new Ajv({
errorDataPath: 'property'
});
var isValid = ajv.validate(schema, data);
if(!isValid) {
throw new Error(ajv.errorsText());
}
}