This commit is contained in:
Hai 2025-09-30 23:39:56 +08:00
parent 4587dbb336
commit 4abdfa94df
4 changed files with 15 additions and 21 deletions

View File

@ -5,11 +5,11 @@
*/
/**
* Include source maps for modules based on their extension (defaults to .js and .css).
* One or multiple conditions used to match resource.
*/
export type Rules = Rule[] | Rule;
/**
* Include source maps for modules based on their extension (defaults to .js and .css).
* Condition used to match resource (string, RegExp or Function).
*/
export type Rule = RegExp | string | ((str: string) => boolean);
@ -50,7 +50,7 @@ export interface SourceMapDevToolPluginOptions {
/**
* Decide whether to ignore source files that match the specified value in the SourceMap.
*/
ignoreList?: Rule[] | Rule;
ignoreList?: Rules;
/**
* Include source maps for module paths that match the given value.
*/

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"definitions": {
"rule": {
"description": "Include source maps for modules based on their extension (defaults to .js and .css).",
"description": "Condition used to match resource (string, RegExp or Function).",
"anyOf": [
{
"instanceof": "RegExp",
@ -18,7 +18,7 @@
]
},
"rules": {
"description": "Include source maps for modules based on their extension (defaults to .js and .css).",
"description": "One or multiple conditions used to match resource.",
"anyOf": [
{
"type": "array",
@ -108,20 +108,9 @@
},
"ignoreList": {
"description": "Decide whether to ignore source files that match the specified value in the SourceMap.",
"anyOf": [
"oneOf": [
{
"type": "array",
"items": {
"description": "ignoreList Rule",
"oneOf": [
{
"$ref": "#/definitions/rule"
}
]
}
},
{
"$ref": "#/definitions/rule"
"$ref": "#/definitions/rules"
}
]
},
@ -168,7 +157,12 @@
"type": "string"
},
"test": {
"$ref": "#/definitions/rules"
"description": "Include source maps for modules based on their extension (defaults to .js and .css).",
"oneOf": [
{
"$ref": "#/definitions/rules"
}
]
}
}
}

2
types.d.ts vendored
View File

@ -16516,7 +16516,7 @@ declare interface SourceMapDevToolPluginOptions {
/**
* Decide whether to ignore source files that match the specified value in the SourceMap.
*/
ignoreList?: string | RegExp | ((str: string) => boolean) | Rule[];
ignoreList?: string | RegExp | Rule[] | ((str: string) => boolean);
/**
* Include source maps for module paths that match the given value.