hexo/node_modules/workbox-build/build/schema/WebpackInjectManifestOption...

762 lines
30 KiB
JSON

{
"additionalProperties": false,
"type": "object",
"properties": {
"additionalManifestEntries": {
"description": "A list of entries to be precached, in addition to any entries that are\ngenerated as part of the build configuration.",
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/ManifestEntry"
},
{
"type": "string"
}
]
}
},
"dontCacheBustURLsMatching": {
"description": "Assets that match this will be assumed to be uniquely versioned via their\nURL, and exempted from the normal HTTP cache-busting that's done when\npopulating the precache. While not required, it's recommended that if your\nexisting build process already inserts a `[hash]` value into each filename,\nyou provide a RegExp that will detect that, as it will reduce the bandwidth\nconsumed when precaching.",
"$ref": "#/definitions/RegExp"
},
"manifestTransforms": {
"description": "One or more functions which will be applied sequentially against the\ngenerated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are\nalso specified, their corresponding transformations will be applied first.",
"type": "array",
"items": {}
},
"maximumFileSizeToCacheInBytes": {
"description": "This value can be used to determine the maximum size of files that will be\nprecached. This prevents you from inadvertently precaching very large files\nthat might have accidentally matched one of your patterns.",
"default": 2097152,
"type": "number"
},
"modifyURLPrefix": {
"description": "An object mapping string prefixes to replacement string values. This can be\nused to, e.g., remove or add a path prefix from a manifest entry if your\nweb hosting setup doesn't match your local filesystem setup. As an\nalternative with more flexibility, you can use the `manifestTransforms`\noption and provide a function that modifies the entries in the manifest\nusing whatever logic you provide.\n\nExample usage:\n\n```\n// Replace a '/dist/' prefix with '/', and also prepend\n// '/static' to every URL.\nmodifyURLPrefix: {\n '/dist/': '/',\n '': '/static',\n}\n```",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"chunks": {
"description": "One or more chunk names whose corresponding output files should be included\nin the precache manifest.",
"type": "array",
"items": {
"type": "string"
}
},
"exclude": {
"description": "One or more specifiers used to exclude assets from the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `exclude` option.\nIf not provided, the default value is `[/\\.map$/, /^manifest.*\\.js$]`.",
"type": "array",
"items": {}
},
"excludeChunks": {
"description": "One or more chunk names whose corresponding output files should be excluded\nfrom the precache manifest.",
"type": "array",
"items": {
"type": "string"
}
},
"include": {
"description": "One or more specifiers used to include assets in the precache manifest.\nThis is interpreted following\n[the same rules](https://webpack.js.org/configuration/module/#condition)\nas `webpack`'s standard `include` option.",
"type": "array",
"items": {}
},
"mode": {
"description": "If set to 'production', then an optimized service worker bundle that\nexcludes debugging info will be produced. If not explicitly configured\nhere, the `mode` value configured in the current `webpack` compilation\nwill be used.",
"type": [
"null",
"string"
]
},
"injectionPoint": {
"description": "The string to find inside of the `swSrc` file. Once found, it will be\nreplaced by the generated precache manifest.",
"default": "self.__WB_MANIFEST",
"type": "string"
},
"swSrc": {
"description": "The path and filename of the service worker file that will be read during\nthe build process, relative to the current working directory.",
"type": "string"
},
"compileSrc": {
"description": "When `true` (the default), the `swSrc` file will be compiled by webpack.\nWhen `false`, compilation will not occur (and `webpackCompilationPlugins`\ncan't be used.) Set to `false` if you want to inject the manifest into,\ne.g., a JSON file.",
"default": true,
"type": "boolean"
},
"swDest": {
"description": "The asset name of the service worker file that will be created by this\nplugin. If omitted, the name will be based on the `swSrc` name.",
"type": "string"
},
"webpackCompilationPlugins": {
"description": "Optional `webpack` plugins that will be used when compiling the `swSrc`\ninput file. Only valid if `compileSrc` is `true`.",
"type": "array",
"items": {}
}
},
"required": [
"swSrc"
],
"definitions": {
"ManifestEntry": {
"type": "object",
"properties": {
"integrity": {
"type": "string"
},
"revision": {
"type": [
"null",
"string"
]
},
"url": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"revision",
"url"
]
},
"RegExp": {
"type": "object",
"properties": {
"source": {
"type": "string"
},
"global": {
"type": "boolean"
},
"ignoreCase": {
"type": "boolean"
},
"multiline": {
"type": "boolean"
},
"lastIndex": {
"type": "number"
},
"flags": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"unicode": {
"type": "boolean"
},
"dotAll": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"dotAll",
"flags",
"global",
"ignoreCase",
"lastIndex",
"multiline",
"source",
"sticky",
"unicode"
]
},
"GoogleAnalyticsInitializeOptions": {
"type": "object",
"properties": {
"cacheName": {
"type": "string"
},
"parameterOverrides": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"hitFilter": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
"RuntimeCaching": {
"type": "object",
"properties": {
"handler": {
"description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.",
"anyOf": [
{
"$ref": "#/definitions/RouteHandlerCallback"
},
{
"$ref": "#/definitions/RouteHandlerObject"
},
{
"enum": [
"CacheFirst",
"CacheOnly",
"NetworkFirst",
"NetworkOnly",
"StaleWhileRevalidate"
],
"type": "string"
}
]
},
"method": {
"description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.",
"default": "GET",
"enum": [
"DELETE",
"GET",
"HEAD",
"PATCH",
"POST",
"PUT"
],
"type": "string"
},
"options": {
"type": "object",
"properties": {
"backgroundSync": {
"description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"options": {
"$ref": "#/definitions/QueueOptions"
}
},
"additionalProperties": false,
"required": [
"name"
]
},
"broadcastUpdate": {
"description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"channelName": {
"type": "string"
},
"options": {
"$ref": "#/definitions/BroadcastCacheUpdateOptions"
}
},
"additionalProperties": false,
"required": [
"options"
]
},
"cacheableResponse": {
"description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheableResponseOptions"
},
"cacheName": {
"description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.",
"type": [
"null",
"string"
]
},
"expiration": {
"description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/ExpirationPluginOptions"
},
"networkTimeoutSeconds": {
"description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.",
"type": "number"
},
"plugins": {
"description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.",
"type": "array",
"items": {
"$ref": "#/definitions/WorkboxPlugin"
}
},
"precacheFallback": {
"description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"fallbackURL": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"fallbackURL"
]
},
"rangeRequests": {
"description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "boolean"
},
"fetchOptions": {
"description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/RequestInit"
},
"matchOptions": {
"description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheQueryOptions"
}
},
"additionalProperties": false
},
"urlPattern": {
"description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.",
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"$ref": "#/definitions/RouteMatchCallback"
},
{
"type": "string"
}
]
}
},
"additionalProperties": false,
"required": [
"handler",
"urlPattern"
]
},
"RouteHandlerCallback": {},
"RouteHandlerObject": {
"description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).",
"type": "object",
"properties": {
"handle": {
"$ref": "#/definitions/RouteHandlerCallback"
}
},
"additionalProperties": false,
"required": [
"handle"
]
},
"QueueOptions": {
"type": "object",
"properties": {
"forceSyncFallback": {
"type": "boolean"
},
"maxRetentionTime": {
"type": "number"
},
"onSync": {
"$ref": "#/definitions/OnSyncCallback"
}
},
"additionalProperties": false
},
"OnSyncCallback": {},
"BroadcastCacheUpdateOptions": {
"type": "object",
"properties": {
"headersToCheck": {
"type": "array",
"items": {
"type": "string"
}
},
"generatePayload": {
"type": "object",
"additionalProperties": false
},
"notifyAllClients": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheableResponseOptions": {
"type": "object",
"properties": {
"statuses": {
"type": "array",
"items": {
"type": "number"
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"ExpirationPluginOptions": {
"type": "object",
"properties": {
"maxEntries": {
"type": "number"
},
"maxAgeSeconds": {
"type": "number"
},
"matchOptions": {
"$ref": "#/definitions/CacheQueryOptions"
},
"purgeOnQuotaError": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheQueryOptions": {
"type": "object",
"properties": {
"ignoreMethod": {
"type": "boolean"
},
"ignoreSearch": {
"type": "boolean"
},
"ignoreVary": {
"type": "boolean"
}
},
"additionalProperties": false
},
"WorkboxPlugin": {
"description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.",
"type": "object",
"properties": {
"cacheDidUpdate": {},
"cachedResponseWillBeUsed": {},
"cacheKeyWillBeUsed": {},
"cacheWillUpdate": {},
"fetchDidFail": {},
"fetchDidSucceed": {},
"handlerDidComplete": {},
"handlerDidError": {},
"handlerDidRespond": {},
"handlerWillRespond": {},
"handlerWillStart": {},
"requestWillFetch": {}
},
"additionalProperties": false
},
"CacheDidUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"CachedResponseWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheKeyWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheWillUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidFailCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidSucceedCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidCompleteCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidErrorCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillStartCallback": {
"type": "object",
"additionalProperties": false
},
"RequestWillFetchCallback": {
"type": "object",
"additionalProperties": false
},
"RequestInit": {
"type": "object",
"properties": {
"body": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/ArrayBufferView"
},
{
"$ref": "#/definitions/Blob"
},
{
"$ref": "#/definitions/FormData"
},
{
"$ref": "#/definitions/URLSearchParams"
},
{
"$ref": "#/definitions/ReadableStream<Uint8Array>"
},
{
"type": [
"null",
"string"
]
}
]
},
"cache": {
"enum": [
"default",
"force-cache",
"no-cache",
"no-store",
"only-if-cached",
"reload"
],
"type": "string"
},
"credentials": {
"enum": [
"include",
"omit",
"same-origin"
],
"type": "string"
},
"headers": {
"anyOf": [
{
"$ref": "#/definitions/Headers"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"$ref": "#/definitions/Record<string,string>"
}
]
},
"integrity": {
"type": "string"
},
"keepalive": {
"type": "boolean"
},
"method": {
"type": "string"
},
"mode": {
"enum": [
"cors",
"navigate",
"no-cors",
"same-origin"
],
"type": "string"
},
"redirect": {
"enum": [
"error",
"follow",
"manual"
],
"type": "string"
},
"referrer": {
"type": "string"
},
"referrerPolicy": {
"enum": [
"",
"no-referrer",
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"same-origin",
"strict-origin",
"strict-origin-when-cross-origin",
"unsafe-url"
],
"type": "string"
},
"signal": {
"anyOf": [
{
"$ref": "#/definitions/AbortSignal"
},
{
"type": "null"
}
]
},
"window": {}
},
"additionalProperties": false
},
"ArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@toStringTag": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"__@toStringTag",
"byteLength"
]
},
"ArrayBufferView": {
"type": "object",
"properties": {
"buffer": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"buffer",
"byteLength",
"byteOffset"
]
},
"SharedArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@species": {
"$ref": "#/definitions/SharedArrayBuffer"
},
"__@toStringTag": {
"type": "string",
"enum": [
"SharedArrayBuffer"
]
}
},
"additionalProperties": false,
"required": [
"__@species",
"__@toStringTag",
"byteLength"
]
},
"Blob": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"size",
"type"
]
},
"FormData": {
"type": "object",
"additionalProperties": false
},
"URLSearchParams": {
"type": "object",
"additionalProperties": false
},
"ReadableStream<Uint8Array>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
},
"Headers": {
"type": "object",
"additionalProperties": false
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
},
"AbortSignal": {
"type": "object",
"properties": {
"aborted": {
"type": "boolean"
},
"onabort": {
"anyOf": [
{
"type": "object",
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"aborted",
"onabort"
]
},
"RouteMatchCallback": {}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}