webpack 5.36.2 → 5.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/lib/Chunk.js +8 -2
- package/lib/Compilation.js +2 -2
- package/lib/Compiler.js +2 -2
- package/lib/EntryPlugin.js +1 -1
- package/lib/FileSystemInfo.js +1 -1
- package/lib/NormalModule.js +16 -2
- package/lib/RuntimeGlobals.js +7 -0
- package/lib/RuntimePlugin.js +19 -1
- package/lib/SourceMapDevToolPlugin.js +1 -1
- package/lib/config/defaults.js +10 -0
- package/lib/config/normalization.js +9 -0
- package/lib/dependencies/CreateScriptUrlDependency.js +54 -0
- package/lib/dependencies/WorkerPlugin.js +14 -1
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +61 -0
- package/lib/runtime/LoadScriptRuntimeModule.js +10 -2
- package/lib/util/fs.js +8 -8
- package/lib/util/internalSerializables.js +2 -0
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +13 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +14 -4
- package/package.json +2 -2
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +31 -0
- package/types.d.ts +386 -40
@@ -2686,6 +2686,22 @@
|
|
2686
2686
|
"strictModuleExceptionHandling": {
|
2687
2687
|
"$ref": "#/definitions/StrictModuleExceptionHandling"
|
2688
2688
|
},
|
2689
|
+
"trustedTypes": {
|
2690
|
+
"description": "Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.",
|
2691
|
+
"anyOf": [
|
2692
|
+
{
|
2693
|
+
"enum": [true]
|
2694
|
+
},
|
2695
|
+
{
|
2696
|
+
"description": "The name of the Trusted Types policy created by webpack to serve bundle chunks.",
|
2697
|
+
"type": "string",
|
2698
|
+
"minLength": 1
|
2699
|
+
},
|
2700
|
+
{
|
2701
|
+
"$ref": "#/definitions/TrustedTypes"
|
2702
|
+
}
|
2703
|
+
]
|
2704
|
+
},
|
2689
2705
|
"umdNamedDefine": {
|
2690
2706
|
"cli": {
|
2691
2707
|
"exclude": true
|
@@ -2839,6 +2855,9 @@
|
|
2839
2855
|
"strictModuleExceptionHandling": {
|
2840
2856
|
"$ref": "#/definitions/StrictModuleExceptionHandling"
|
2841
2857
|
},
|
2858
|
+
"trustedTypes": {
|
2859
|
+
"$ref": "#/definitions/TrustedTypes"
|
2860
|
+
},
|
2842
2861
|
"uniqueName": {
|
2843
2862
|
"$ref": "#/definitions/UniqueName"
|
2844
2863
|
},
|
@@ -4356,6 +4375,18 @@
|
|
4356
4375
|
}
|
4357
4376
|
]
|
4358
4377
|
},
|
4378
|
+
"TrustedTypes": {
|
4379
|
+
"description": "Use a Trusted Types policy to create urls for chunks.",
|
4380
|
+
"type": "object",
|
4381
|
+
"additionalProperties": false,
|
4382
|
+
"properties": {
|
4383
|
+
"policyName": {
|
4384
|
+
"description": "The name of the Trusted Types policy created by webpack to serve bundle chunks.",
|
4385
|
+
"type": "string",
|
4386
|
+
"minLength": 1
|
4387
|
+
}
|
4388
|
+
}
|
4389
|
+
},
|
4359
4390
|
"UmdNamedDefine": {
|
4360
4391
|
"description": "If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.",
|
4361
4392
|
"type": "boolean"
|
package/types.d.ts
CHANGED
@@ -79,12 +79,8 @@ import {
|
|
79
79
|
WithStatement,
|
80
80
|
YieldExpression
|
81
81
|
} from "estree";
|
82
|
-
import {
|
83
|
-
import {
|
84
|
-
import {
|
85
|
-
Extend,
|
86
|
-
ValidationErrorConfiguration
|
87
|
-
} from "schema-utils/declarations/validate";
|
82
|
+
import { ValidationError, validate as validateFunction } from "schema-utils";
|
83
|
+
import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
|
88
84
|
import {
|
89
85
|
AsArray,
|
90
86
|
AsyncParallelHook,
|
@@ -153,6 +149,10 @@ declare class AbstractLibraryPlugin<T> {
|
|
153
149
|
): void;
|
154
150
|
static COMMON_LIBRARY_NAME_MESSAGE: string;
|
155
151
|
}
|
152
|
+
declare interface AdditionalData {
|
153
|
+
[index: string]: any;
|
154
|
+
webpackAST: object;
|
155
|
+
}
|
156
156
|
declare class AggressiveMergingPlugin {
|
157
157
|
constructor(options?: any);
|
158
158
|
options: any;
|
@@ -1650,8 +1650,8 @@ declare class Compilation {
|
|
1650
1650
|
*/
|
1651
1651
|
createChildCompiler(
|
1652
1652
|
name: string,
|
1653
|
-
outputOptions
|
1654
|
-
plugins
|
1653
|
+
outputOptions?: OutputNormalized,
|
1654
|
+
plugins?: (
|
1655
1655
|
| ((this: Compiler, compiler: Compiler) => void)
|
1656
1656
|
| WebpackPluginInstance
|
1657
1657
|
)[]
|
@@ -1855,8 +1855,8 @@ declare class Compiler {
|
|
1855
1855
|
compilation: Compilation,
|
1856
1856
|
compilerName: string,
|
1857
1857
|
compilerIndex: number,
|
1858
|
-
outputOptions
|
1859
|
-
plugins
|
1858
|
+
outputOptions?: OutputNormalized,
|
1859
|
+
plugins?: WebpackPluginInstance[]
|
1860
1860
|
): Compiler;
|
1861
1861
|
isChild(): boolean;
|
1862
1862
|
createCompilation(): Compilation;
|
@@ -3035,7 +3035,7 @@ declare class EntryPlugin {
|
|
3035
3035
|
* An entry plugin which will handle
|
3036
3036
|
* creation of the EntryDependency
|
3037
3037
|
*/
|
3038
|
-
constructor(context: string, entry: string, options
|
3038
|
+
constructor(context: string, entry: string, options?: string | EntryOptions);
|
3039
3039
|
context: string;
|
3040
3040
|
entry: string;
|
3041
3041
|
options: string | EntryOptions;
|
@@ -4194,7 +4194,7 @@ declare interface HashedModuleIdsPluginOptions {
|
|
4194
4194
|
/**
|
4195
4195
|
* The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
|
4196
4196
|
*/
|
4197
|
-
hashDigest?: "
|
4197
|
+
hashDigest?: "base64" | "latin1" | "hex";
|
4198
4198
|
|
4199
4199
|
/**
|
4200
4200
|
* The prefix length of the hash digest to use, defaults to 4.
|
@@ -4217,6 +4217,13 @@ declare class HotModuleReplacementPlugin {
|
|
4217
4217
|
apply(compiler: Compiler): void;
|
4218
4218
|
static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
|
4219
4219
|
}
|
4220
|
+
|
4221
|
+
/**
|
4222
|
+
* These properties are added by the HotModuleReplacementPlugin
|
4223
|
+
*/
|
4224
|
+
declare interface HotModuleReplacementPluginLoaderContext {
|
4225
|
+
hot?: boolean;
|
4226
|
+
}
|
4220
4227
|
declare class HotUpdateChunk extends Chunk {
|
4221
4228
|
constructor();
|
4222
4229
|
}
|
@@ -4305,6 +4312,17 @@ type IgnorePluginOptions =
|
|
4305
4312
|
*/
|
4306
4313
|
checkResource?: (resource: string, context: string) => boolean;
|
4307
4314
|
};
|
4315
|
+
declare interface ImportModuleOptions {
|
4316
|
+
/**
|
4317
|
+
* the target layer
|
4318
|
+
*/
|
4319
|
+
layer?: string;
|
4320
|
+
|
4321
|
+
/**
|
4322
|
+
* the target public path
|
4323
|
+
*/
|
4324
|
+
publicPath?: string;
|
4325
|
+
}
|
4308
4326
|
type ImportSource =
|
4309
4327
|
| undefined
|
4310
4328
|
| null
|
@@ -4365,30 +4383,30 @@ declare abstract class InitFragment {
|
|
4365
4383
|
declare interface InputFileSystem {
|
4366
4384
|
readFile: (
|
4367
4385
|
arg0: string,
|
4368
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
4386
|
+
arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
4369
4387
|
) => void;
|
4370
4388
|
readJson?: (
|
4371
4389
|
arg0: string,
|
4372
|
-
arg1: (arg0?: Error | NodeJS.ErrnoException, arg1?: any) => void
|
4390
|
+
arg1: (arg0?: null | Error | NodeJS.ErrnoException, arg1?: any) => void
|
4373
4391
|
) => void;
|
4374
4392
|
readlink: (
|
4375
4393
|
arg0: string,
|
4376
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
4394
|
+
arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
4377
4395
|
) => void;
|
4378
4396
|
readdir: (
|
4379
4397
|
arg0: string,
|
4380
4398
|
arg1: (
|
4381
|
-
arg0?: NodeJS.ErrnoException,
|
4399
|
+
arg0?: null | NodeJS.ErrnoException,
|
4382
4400
|
arg1?: (string | Buffer)[] | IDirent[]
|
4383
4401
|
) => void
|
4384
4402
|
) => void;
|
4385
4403
|
stat: (
|
4386
4404
|
arg0: string,
|
4387
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
|
4405
|
+
arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
|
4388
4406
|
) => void;
|
4389
4407
|
realpath?: (
|
4390
4408
|
arg0: string,
|
4391
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
4409
|
+
arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
4392
4410
|
) => void;
|
4393
4411
|
purge?: (arg0?: string) => void;
|
4394
4412
|
join?: (arg0: string, arg1: string) => string;
|
@@ -4404,7 +4422,7 @@ declare interface IntermediateFileSystemExtras {
|
|
4404
4422
|
open: (
|
4405
4423
|
arg0: string,
|
4406
4424
|
arg1: string,
|
4407
|
-
arg2: (arg0?: NodeJS.ErrnoException, arg1?: number) => void
|
4425
|
+
arg2: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
|
4408
4426
|
) => void;
|
4409
4427
|
read: (
|
4410
4428
|
arg0: number,
|
@@ -4412,13 +4430,16 @@ declare interface IntermediateFileSystemExtras {
|
|
4412
4430
|
arg2: number,
|
4413
4431
|
arg3: number,
|
4414
4432
|
arg4: number,
|
4415
|
-
arg5: (arg0?: NodeJS.ErrnoException, arg1?: number) => void
|
4433
|
+
arg5: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
|
4434
|
+
) => void;
|
4435
|
+
close: (
|
4436
|
+
arg0: number,
|
4437
|
+
arg1: (arg0?: null | NodeJS.ErrnoException) => void
|
4416
4438
|
) => void;
|
4417
|
-
close: (arg0: number, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
|
4418
4439
|
rename: (
|
4419
4440
|
arg0: string,
|
4420
4441
|
arg1: string,
|
4421
|
-
arg2: (arg0?: NodeJS.ErrnoException) => void
|
4442
|
+
arg2: (arg0?: null | NodeJS.ErrnoException) => void
|
4422
4443
|
) => void;
|
4423
4444
|
}
|
4424
4445
|
type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
|
@@ -5748,7 +5769,7 @@ declare interface LoadScriptCompilationHooks {
|
|
5748
5769
|
createScript: SyncWaterfallHook<[string, Chunk]>;
|
5749
5770
|
}
|
5750
5771
|
declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
|
5751
|
-
constructor();
|
5772
|
+
constructor(withCreateScriptUrl?: boolean);
|
5752
5773
|
static getCompilationHooks(
|
5753
5774
|
compilation: Compilation
|
5754
5775
|
): LoadScriptCompilationHooks;
|
@@ -5780,12 +5801,45 @@ declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
|
|
5780
5801
|
declare interface Loader {
|
5781
5802
|
[index: string]: any;
|
5782
5803
|
}
|
5804
|
+
type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
|
5805
|
+
LoaderRunnerLoaderContext<OptionsType> &
|
5806
|
+
LoaderPluginLoaderContext &
|
5807
|
+
HotModuleReplacementPluginLoaderContext;
|
5808
|
+
type LoaderDefinition<
|
5809
|
+
OptionsType = {},
|
5810
|
+
ContextAdditions = {}
|
5811
|
+
> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
5812
|
+
raw?: false;
|
5813
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
5814
|
+
};
|
5815
|
+
declare interface LoaderDefinitionFunction<
|
5816
|
+
OptionsType = {},
|
5817
|
+
ContextAdditions = {}
|
5818
|
+
> {
|
5819
|
+
(
|
5820
|
+
this: NormalModuleLoaderContext<OptionsType> &
|
5821
|
+
LoaderRunnerLoaderContext<OptionsType> &
|
5822
|
+
LoaderPluginLoaderContext &
|
5823
|
+
HotModuleReplacementPluginLoaderContext &
|
5824
|
+
ContextAdditions,
|
5825
|
+
content: string,
|
5826
|
+
sourceMap?: string | SourceMap,
|
5827
|
+
additionalData?: AdditionalData
|
5828
|
+
): string | void | Buffer | Promise<string | Buffer>;
|
5829
|
+
}
|
5783
5830
|
declare interface LoaderItem {
|
5784
5831
|
loader: string;
|
5785
5832
|
options: any;
|
5786
5833
|
ident: null | string;
|
5787
5834
|
type: null | string;
|
5788
5835
|
}
|
5836
|
+
declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
|
5837
|
+
default?:
|
5838
|
+
| RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
|
5839
|
+
| LoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
5840
|
+
raw?: false;
|
5841
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
5842
|
+
}
|
5789
5843
|
declare class LoaderOptionsPlugin {
|
5790
5844
|
constructor(options?: LoaderOptionsPluginOptions);
|
5791
5845
|
options: LoaderOptionsPluginOptions;
|
@@ -5819,6 +5873,165 @@ declare interface LoaderOptionsPluginOptions {
|
|
5819
5873
|
context?: string;
|
5820
5874
|
};
|
5821
5875
|
}
|
5876
|
+
|
5877
|
+
/**
|
5878
|
+
* These properties are added by the LoaderPlugin
|
5879
|
+
*/
|
5880
|
+
declare interface LoaderPluginLoaderContext {
|
5881
|
+
/**
|
5882
|
+
* Resolves the given request to a module, applies all configured loaders and calls
|
5883
|
+
* back with the generated source, the sourceMap and the module instance (usually an
|
5884
|
+
* instance of NormalModule). Use this function if you need to know the source code
|
5885
|
+
* of another module to generate the result.
|
5886
|
+
*/
|
5887
|
+
loadModule(
|
5888
|
+
request: string,
|
5889
|
+
callback: (
|
5890
|
+
err: null | Error,
|
5891
|
+
source: string,
|
5892
|
+
sourceMap: any,
|
5893
|
+
module: NormalModule
|
5894
|
+
) => void
|
5895
|
+
): void;
|
5896
|
+
importModule(
|
5897
|
+
request: string,
|
5898
|
+
options: ImportModuleOptions,
|
5899
|
+
callback: (err?: Error, exports?: any) => any
|
5900
|
+
): void;
|
5901
|
+
importModule(request: string, options?: ImportModuleOptions): Promise<any>;
|
5902
|
+
}
|
5903
|
+
|
5904
|
+
/**
|
5905
|
+
* The properties are added by https://github.com/webpack/loader-runner
|
5906
|
+
*/
|
5907
|
+
declare interface LoaderRunnerLoaderContext<OptionsType> {
|
5908
|
+
/**
|
5909
|
+
* Add a directory as dependency of the loader result.
|
5910
|
+
*/
|
5911
|
+
addContextDependency(context: string): void;
|
5912
|
+
|
5913
|
+
/**
|
5914
|
+
* Adds a file as dependency of the loader result in order to make them watchable.
|
5915
|
+
* For example, html-loader uses this technique as it finds src and src-set attributes.
|
5916
|
+
* Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
|
5917
|
+
*/
|
5918
|
+
addDependency(file: string): void;
|
5919
|
+
addMissingDependency(context: string): void;
|
5920
|
+
|
5921
|
+
/**
|
5922
|
+
* Make this loader async.
|
5923
|
+
*/
|
5924
|
+
async(): (
|
5925
|
+
err?: null | Error,
|
5926
|
+
content?: string | Buffer,
|
5927
|
+
sourceMap?: string | SourceMap,
|
5928
|
+
additionalData?: AdditionalData
|
5929
|
+
) => void;
|
5930
|
+
|
5931
|
+
/**
|
5932
|
+
* Make this loader result cacheable. By default it's cacheable.
|
5933
|
+
* A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
|
5934
|
+
* This means the loader shouldn't have other dependencies than specified with this.addDependency.
|
5935
|
+
* Most loaders are deterministic and cacheable.
|
5936
|
+
*/
|
5937
|
+
cacheable(flag?: boolean): void;
|
5938
|
+
callback: (
|
5939
|
+
err?: null | Error,
|
5940
|
+
content?: string | Buffer,
|
5941
|
+
sourceMap?: string | SourceMap,
|
5942
|
+
additionalData?: AdditionalData
|
5943
|
+
) => void;
|
5944
|
+
|
5945
|
+
/**
|
5946
|
+
* Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
|
5947
|
+
*/
|
5948
|
+
clearDependencies(): void;
|
5949
|
+
|
5950
|
+
/**
|
5951
|
+
* The directory of the module. Can be used as context for resolving other stuff.
|
5952
|
+
* eg '/workspaces/ts-loader/examples/vanilla/src'
|
5953
|
+
*/
|
5954
|
+
context: string;
|
5955
|
+
readonly currentRequest: string;
|
5956
|
+
readonly data: any;
|
5957
|
+
|
5958
|
+
/**
|
5959
|
+
* alias of addDependency
|
5960
|
+
* Adds a file as dependency of the loader result in order to make them watchable.
|
5961
|
+
* For example, html-loader uses this technique as it finds src and src-set attributes.
|
5962
|
+
* Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
|
5963
|
+
*/
|
5964
|
+
dependency(file: string): void;
|
5965
|
+
getContextDependencies(): string[];
|
5966
|
+
getDependencies(): string[];
|
5967
|
+
getMissingDependencies(): string[];
|
5968
|
+
|
5969
|
+
/**
|
5970
|
+
* The index in the loaders array of the current loader.
|
5971
|
+
* In the example: in loader1: 0, in loader2: 1
|
5972
|
+
*/
|
5973
|
+
loaderIndex: number;
|
5974
|
+
readonly previousRequest: string;
|
5975
|
+
readonly query: string | OptionsType;
|
5976
|
+
readonly remainingRequest: string;
|
5977
|
+
readonly request: string;
|
5978
|
+
|
5979
|
+
/**
|
5980
|
+
* An array of all the loaders. It is writeable in the pitch phase.
|
5981
|
+
* loaders = [{request: string, path: string, query: string, module: function}]
|
5982
|
+
* In the example:
|
5983
|
+
* [
|
5984
|
+
* { request: "/abc/loader1.js?xyz",
|
5985
|
+
* path: "/abc/loader1.js",
|
5986
|
+
* query: "?xyz",
|
5987
|
+
* module: [Function]
|
5988
|
+
* },
|
5989
|
+
* { request: "/abc/node_modules/loader2/index.js",
|
5990
|
+
* path: "/abc/node_modules/loader2/index.js",
|
5991
|
+
* query: "",
|
5992
|
+
* module: [Function]
|
5993
|
+
* }
|
5994
|
+
* ]
|
5995
|
+
*/
|
5996
|
+
loaders: {
|
5997
|
+
request: string;
|
5998
|
+
path: string;
|
5999
|
+
query: string;
|
6000
|
+
fragment: string;
|
6001
|
+
options?: string | object;
|
6002
|
+
ident: string;
|
6003
|
+
normal?: Function;
|
6004
|
+
pitch?: Function;
|
6005
|
+
raw?: boolean;
|
6006
|
+
data?: object;
|
6007
|
+
pitchExecuted: boolean;
|
6008
|
+
normalExecuted: boolean;
|
6009
|
+
}[];
|
6010
|
+
|
6011
|
+
/**
|
6012
|
+
* The resource path.
|
6013
|
+
* In the example: "/abc/resource.js"
|
6014
|
+
*/
|
6015
|
+
resourcePath: string;
|
6016
|
+
|
6017
|
+
/**
|
6018
|
+
* The resource query string.
|
6019
|
+
* Example: "?query"
|
6020
|
+
*/
|
6021
|
+
resourceQuery: string;
|
6022
|
+
|
6023
|
+
/**
|
6024
|
+
* The resource fragment.
|
6025
|
+
* Example: "#frag"
|
6026
|
+
*/
|
6027
|
+
resourceFragment: string;
|
6028
|
+
|
6029
|
+
/**
|
6030
|
+
* The resource inclusive query and fragment.
|
6031
|
+
* Example: "/abc/resource.js?query#frag"
|
6032
|
+
*/
|
6033
|
+
resource: string;
|
6034
|
+
}
|
5822
6035
|
declare class LoaderTargetPlugin {
|
5823
6036
|
constructor(target: string);
|
5824
6037
|
target: string;
|
@@ -6888,7 +7101,7 @@ declare class NormalModule extends Module {
|
|
6888
7101
|
options: WebpackOptionsNormalized,
|
6889
7102
|
compilation: Compilation,
|
6890
7103
|
fs: InputFileSystem
|
6891
|
-
): any
|
7104
|
+
): NormalModuleLoaderContext<any>;
|
6892
7105
|
getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
|
6893
7106
|
createSource(
|
6894
7107
|
context: string,
|
@@ -6964,6 +7177,60 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
|
6964
7177
|
createGenerator(type?: any, generatorOptions?: object): any;
|
6965
7178
|
getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
|
6966
7179
|
}
|
7180
|
+
|
7181
|
+
/**
|
7182
|
+
* These properties are added by the NormalModule
|
7183
|
+
*/
|
7184
|
+
declare interface NormalModuleLoaderContext<OptionsType> {
|
7185
|
+
version: number;
|
7186
|
+
getOptions(): OptionsType;
|
7187
|
+
getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
|
7188
|
+
emitWarning(warning: Error): void;
|
7189
|
+
emitError(error: Error): void;
|
7190
|
+
getLogger(name?: string): WebpackLogger;
|
7191
|
+
resolve(
|
7192
|
+
context: string,
|
7193
|
+
request: string,
|
7194
|
+
callback: (
|
7195
|
+
arg0: null | Error,
|
7196
|
+
arg1?: string | false,
|
7197
|
+
arg2?: ResolveRequest
|
7198
|
+
) => void
|
7199
|
+
): any;
|
7200
|
+
getResolve(
|
7201
|
+
options?: ResolveOptionsWithDependencyType
|
7202
|
+
): {
|
7203
|
+
(
|
7204
|
+
context: string,
|
7205
|
+
request: string,
|
7206
|
+
callback: (
|
7207
|
+
arg0: null | Error,
|
7208
|
+
arg1?: string | false,
|
7209
|
+
arg2?: ResolveRequest
|
7210
|
+
) => void
|
7211
|
+
): void;
|
7212
|
+
(context: string, request: string): Promise<string>;
|
7213
|
+
};
|
7214
|
+
emitFile(
|
7215
|
+
name: string,
|
7216
|
+
content: string,
|
7217
|
+
sourceMap?: string,
|
7218
|
+
assetInfo?: AssetInfo
|
7219
|
+
): void;
|
7220
|
+
addBuildDependency(dep: string): void;
|
7221
|
+
utils: {
|
7222
|
+
absolutify: (context: string, request: string) => string;
|
7223
|
+
contextify: (context: string, request: string) => string;
|
7224
|
+
};
|
7225
|
+
rootContext: string;
|
7226
|
+
fs: InputFileSystem;
|
7227
|
+
sourceMap?: boolean;
|
7228
|
+
mode: "development" | "production" | "none";
|
7229
|
+
webpack?: boolean;
|
7230
|
+
_module?: NormalModule;
|
7231
|
+
_compilation?: Compilation;
|
7232
|
+
_compiler?: Compiler;
|
7233
|
+
}
|
6967
7234
|
declare class NormalModuleReplacementPlugin {
|
6968
7235
|
/**
|
6969
7236
|
* Create an instance of the plugin
|
@@ -7675,6 +7942,11 @@ declare interface Output {
|
|
7675
7942
|
*/
|
7676
7943
|
strictModuleExceptionHandling?: boolean;
|
7677
7944
|
|
7945
|
+
/**
|
7946
|
+
* Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.
|
7947
|
+
*/
|
7948
|
+
trustedTypes?: string | true | TrustedTypes;
|
7949
|
+
|
7678
7950
|
/**
|
7679
7951
|
* If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
|
7680
7952
|
*/
|
@@ -7709,25 +7981,34 @@ declare interface OutputFileSystem {
|
|
7709
7981
|
writeFile: (
|
7710
7982
|
arg0: string,
|
7711
7983
|
arg1: string | Buffer,
|
7712
|
-
arg2: (arg0?: NodeJS.ErrnoException) => void
|
7984
|
+
arg2: (arg0?: null | NodeJS.ErrnoException) => void
|
7985
|
+
) => void;
|
7986
|
+
mkdir: (
|
7987
|
+
arg0: string,
|
7988
|
+
arg1: (arg0?: null | NodeJS.ErrnoException) => void
|
7713
7989
|
) => void;
|
7714
|
-
mkdir: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
|
7715
7990
|
readdir?: (
|
7716
7991
|
arg0: string,
|
7717
7992
|
arg1: (
|
7718
|
-
arg0?: NodeJS.ErrnoException,
|
7993
|
+
arg0?: null | NodeJS.ErrnoException,
|
7719
7994
|
arg1?: (string | Buffer)[] | IDirent[]
|
7720
7995
|
) => void
|
7721
7996
|
) => void;
|
7722
|
-
rmdir?: (
|
7723
|
-
|
7997
|
+
rmdir?: (
|
7998
|
+
arg0: string,
|
7999
|
+
arg1: (arg0?: null | NodeJS.ErrnoException) => void
|
8000
|
+
) => void;
|
8001
|
+
unlink?: (
|
8002
|
+
arg0: string,
|
8003
|
+
arg1: (arg0?: null | NodeJS.ErrnoException) => void
|
8004
|
+
) => void;
|
7724
8005
|
stat: (
|
7725
8006
|
arg0: string,
|
7726
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
|
8007
|
+
arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
|
7727
8008
|
) => void;
|
7728
8009
|
readFile: (
|
7729
8010
|
arg0: string,
|
7730
|
-
arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
8011
|
+
arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
|
7731
8012
|
) => void;
|
7732
8013
|
join?: (arg0: string, arg1: string) => string;
|
7733
8014
|
relative?: (arg0: string, arg1: string) => string;
|
@@ -7937,6 +8218,11 @@ declare interface OutputNormalized {
|
|
7937
8218
|
*/
|
7938
8219
|
strictModuleExceptionHandling?: boolean;
|
7939
8220
|
|
8221
|
+
/**
|
8222
|
+
* Use a Trusted Types policy to create urls for chunks.
|
8223
|
+
*/
|
8224
|
+
trustedTypes?: TrustedTypes;
|
8225
|
+
|
7940
8226
|
/**
|
7941
8227
|
* A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
|
7942
8228
|
*/
|
@@ -8083,6 +8369,21 @@ declare interface PerformanceOptions {
|
|
8083
8369
|
*/
|
8084
8370
|
maxEntrypointSize?: number;
|
8085
8371
|
}
|
8372
|
+
declare interface PitchLoaderDefinitionFunction<
|
8373
|
+
OptionsType = {},
|
8374
|
+
ContextAdditions = {}
|
8375
|
+
> {
|
8376
|
+
(
|
8377
|
+
this: NormalModuleLoaderContext<OptionsType> &
|
8378
|
+
LoaderRunnerLoaderContext<OptionsType> &
|
8379
|
+
LoaderPluginLoaderContext &
|
8380
|
+
HotModuleReplacementPluginLoaderContext &
|
8381
|
+
ContextAdditions,
|
8382
|
+
remainingRequest: string,
|
8383
|
+
previousRequest: string,
|
8384
|
+
data: object
|
8385
|
+
): string | void | Buffer | Promise<string | Buffer>;
|
8386
|
+
}
|
8086
8387
|
type Plugin =
|
8087
8388
|
| { apply: (arg0: Resolver) => void }
|
8088
8389
|
| ((this: Resolver, arg1: Resolver) => void);
|
@@ -8370,6 +8671,28 @@ declare interface RawChunkGroupOptions {
|
|
8370
8671
|
preloadOrder?: number;
|
8371
8672
|
prefetchOrder?: number;
|
8372
8673
|
}
|
8674
|
+
type RawLoaderDefinition<
|
8675
|
+
OptionsType = {},
|
8676
|
+
ContextAdditions = {}
|
8677
|
+
> = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
8678
|
+
raw: true;
|
8679
|
+
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
8680
|
+
};
|
8681
|
+
declare interface RawLoaderDefinitionFunction<
|
8682
|
+
OptionsType = {},
|
8683
|
+
ContextAdditions = {}
|
8684
|
+
> {
|
8685
|
+
(
|
8686
|
+
this: NormalModuleLoaderContext<OptionsType> &
|
8687
|
+
LoaderRunnerLoaderContext<OptionsType> &
|
8688
|
+
LoaderPluginLoaderContext &
|
8689
|
+
HotModuleReplacementPluginLoaderContext &
|
8690
|
+
ContextAdditions,
|
8691
|
+
content: Buffer,
|
8692
|
+
sourceMap?: string | SourceMap,
|
8693
|
+
additionalData?: AdditionalData
|
8694
|
+
): string | void | Buffer | Promise<string | Buffer>;
|
8695
|
+
}
|
8373
8696
|
declare class RawSource extends Source {
|
8374
8697
|
constructor(source: string | Buffer, convertToString?: boolean);
|
8375
8698
|
isBuffer(): boolean;
|
@@ -9955,10 +10278,6 @@ declare interface RuntimeValueOptions {
|
|
9955
10278
|
buildDependencies?: string[];
|
9956
10279
|
version?: string | (() => string);
|
9957
10280
|
}
|
9958
|
-
type Schema =
|
9959
|
-
| (JSONSchema4 & Extend)
|
9960
|
-
| (JSONSchema6 & Extend)
|
9961
|
-
| (JSONSchema7 & Extend);
|
9962
10281
|
declare interface ScopeInfo {
|
9963
10282
|
definitions: StackedMap<string, ScopeInfo | VariableInfo>;
|
9964
10283
|
topLevelScope: boolean | "arrow";
|
@@ -10234,6 +10553,15 @@ declare interface SourceData {
|
|
10234
10553
|
declare interface SourceLike {
|
10235
10554
|
source(): string | Buffer;
|
10236
10555
|
}
|
10556
|
+
declare interface SourceMap {
|
10557
|
+
version: number;
|
10558
|
+
sources: string[];
|
10559
|
+
mappings: string;
|
10560
|
+
file?: string;
|
10561
|
+
sourceRoot?: string;
|
10562
|
+
sourcesContent?: string[];
|
10563
|
+
names?: string[];
|
10564
|
+
}
|
10237
10565
|
declare class SourceMapDevToolPlugin {
|
10238
10566
|
constructor(options?: SourceMapDevToolPluginOptions);
|
10239
10567
|
sourceMapFilename: string | false;
|
@@ -10985,6 +11313,16 @@ declare interface TimestampAndHash {
|
|
10985
11313
|
timestampHash?: string;
|
10986
11314
|
hash: string;
|
10987
11315
|
}
|
11316
|
+
|
11317
|
+
/**
|
11318
|
+
* Use a Trusted Types policy to create urls for chunks.
|
11319
|
+
*/
|
11320
|
+
declare interface TrustedTypes {
|
11321
|
+
/**
|
11322
|
+
* The name of the Trusted Types policy created by webpack to serve bundle chunks.
|
11323
|
+
*/
|
11324
|
+
policyName?: string;
|
11325
|
+
}
|
10988
11326
|
declare const UNDEFINED_MARKER: unique symbol;
|
10989
11327
|
declare interface UpdateHashContextDependency {
|
10990
11328
|
chunkGraph: ChunkGraph;
|
@@ -11623,8 +11961,8 @@ declare namespace exports {
|
|
11623
11961
|
};
|
11624
11962
|
export const validate: (options?: any) => void;
|
11625
11963
|
export const validateSchema: (
|
11626
|
-
schema:
|
11627
|
-
options:
|
11964
|
+
schema: Parameters<typeof validateFunction>[0],
|
11965
|
+
options: Parameters<typeof validateFunction>[1],
|
11628
11966
|
validationConfiguration?: ValidationErrorConfiguration
|
11629
11967
|
) => void;
|
11630
11968
|
export const version: string;
|
@@ -11712,6 +12050,7 @@ declare namespace exports {
|
|
11712
12050
|
export let uncaughtErrorHandler: string;
|
11713
12051
|
export let scriptNonce: string;
|
11714
12052
|
export let loadScript: string;
|
12053
|
+
export let createScriptUrl: string;
|
11715
12054
|
export let chunkName: string;
|
11716
12055
|
export let runtimeId: string;
|
11717
12056
|
export let getChunkScriptFilename: string;
|
@@ -11750,8 +12089,6 @@ declare namespace exports {
|
|
11750
12089
|
Unknown: 3;
|
11751
12090
|
Used: 4;
|
11752
12091
|
}>;
|
11753
|
-
export const WebpackOptionsValidationError: ValidationError;
|
11754
|
-
export const ValidationError: ValidationError;
|
11755
12092
|
export namespace cache {
|
11756
12093
|
export { MemoryCachePlugin };
|
11757
12094
|
}
|
@@ -12010,6 +12347,8 @@ declare namespace exports {
|
|
12010
12347
|
WebpackError,
|
12011
12348
|
WebpackOptionsApply,
|
12012
12349
|
WebpackOptionsDefaulter,
|
12350
|
+
ValidationError as WebpackOptionsValidationError,
|
12351
|
+
ValidationError,
|
12013
12352
|
Entry,
|
12014
12353
|
EntryNormalized,
|
12015
12354
|
EntryObject,
|
@@ -12042,7 +12381,14 @@ declare namespace exports {
|
|
12042
12381
|
StatsModuleReason,
|
12043
12382
|
StatsModuleTraceDependency,
|
12044
12383
|
StatsModuleTraceItem,
|
12045
|
-
StatsProfile
|
12384
|
+
StatsProfile,
|
12385
|
+
LoaderModule,
|
12386
|
+
RawLoaderDefinition,
|
12387
|
+
LoaderDefinition,
|
12388
|
+
LoaderDefinitionFunction,
|
12389
|
+
PitchLoaderDefinitionFunction,
|
12390
|
+
RawLoaderDefinitionFunction,
|
12391
|
+
LoaderContext
|
12046
12392
|
};
|
12047
12393
|
}
|
12048
12394
|
|