webpack 5.37.0 → 5.39.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.

Files changed (139) hide show
  1. package/README.md +5 -8
  2. package/bin/webpack.js +20 -5
  3. package/lib/AsyncDependencyToInitialChunkError.js +0 -2
  4. package/lib/CacheFacade.js +3 -3
  5. package/lib/CaseSensitiveModulesWarning.js +0 -2
  6. package/lib/Chunk.js +8 -5
  7. package/lib/ChunkRenderError.js +0 -2
  8. package/lib/CodeGenerationError.js +0 -2
  9. package/lib/CommentCompilationWarning.js +0 -2
  10. package/lib/Compilation.js +43 -55
  11. package/lib/Compiler.js +7 -4
  12. package/lib/ConcatenationScope.js +2 -1
  13. package/lib/ConcurrentCompilationError.js +0 -2
  14. package/lib/ContextModule.js +5 -4
  15. package/lib/ContextModuleFactory.js +3 -1
  16. package/lib/ContextReplacementPlugin.js +4 -3
  17. package/lib/DefinePlugin.js +16 -12
  18. package/lib/DllReferencePlugin.js +0 -2
  19. package/lib/EntryPlugin.js +3 -3
  20. package/lib/EvalSourceMapDevToolPlugin.js +3 -1
  21. package/lib/ExportsInfo.js +20 -13
  22. package/lib/FileSystemInfo.js +24 -30
  23. package/lib/FlagDependencyExportsPlugin.js +8 -7
  24. package/lib/FlagDependencyUsagePlugin.js +2 -4
  25. package/lib/HarmonyLinkingError.js +0 -2
  26. package/lib/HookWebpackError.js +0 -1
  27. package/lib/HotModuleReplacementPlugin.js +27 -32
  28. package/lib/InvalidDependenciesModuleWarning.js +0 -2
  29. package/lib/JavascriptMetaInfoPlugin.js +2 -1
  30. package/lib/MainTemplate.js +2 -3
  31. package/lib/ModuleBuildError.js +0 -2
  32. package/lib/ModuleDependencyError.js +0 -2
  33. package/lib/ModuleDependencyWarning.js +0 -2
  34. package/lib/ModuleError.js +0 -2
  35. package/lib/ModuleFilenameHelpers.js +4 -2
  36. package/lib/ModuleGraphConnection.js +6 -2
  37. package/lib/ModuleInfoHeaderPlugin.js +2 -3
  38. package/lib/ModuleNotFoundError.js +0 -2
  39. package/lib/ModuleParseError.js +0 -2
  40. package/lib/ModuleRestoreError.js +0 -2
  41. package/lib/ModuleStoreError.js +0 -2
  42. package/lib/ModuleWarning.js +0 -2
  43. package/lib/MultiCompiler.js +31 -27
  44. package/lib/NoModeWarning.js +0 -2
  45. package/lib/NormalModule.js +26 -8
  46. package/lib/NormalModuleFactory.js +2 -0
  47. package/lib/RecordIdsPlugin.js +5 -4
  48. package/lib/ResolverFactory.js +10 -7
  49. package/lib/SourceMapDevToolPlugin.js +13 -14
  50. package/lib/Template.js +4 -2
  51. package/lib/UnsupportedFeatureWarning.js +0 -2
  52. package/lib/WarnDeprecatedOptionPlugin.js +0 -2
  53. package/lib/Watching.js +91 -47
  54. package/lib/WebpackError.js +0 -2
  55. package/lib/asset/AssetGenerator.js +46 -29
  56. package/lib/asset/AssetModulesPlugin.js +1 -1
  57. package/lib/buildChunkGraph.js +21 -21
  58. package/lib/cache/PackFileCacheStrategy.js +12 -9
  59. package/lib/config/defaults.js +21 -10
  60. package/lib/config/normalization.js +8 -7
  61. package/lib/config/target.js +7 -2
  62. package/lib/debug/ProfilingPlugin.js +4 -3
  63. package/lib/dependencies/AMDRequireDependency.js +3 -3
  64. package/lib/dependencies/CommonJsExportRequireDependency.js +2 -3
  65. package/lib/dependencies/CommonJsExportsParserPlugin.js +3 -1
  66. package/lib/dependencies/CommonJsImportsParserPlugin.js +2 -4
  67. package/lib/dependencies/CommonJsPlugin.js +8 -7
  68. package/lib/dependencies/CommonJsRequireContextDependency.js +2 -1
  69. package/lib/dependencies/ContextDependencyHelpers.js +10 -8
  70. package/lib/dependencies/ContextElementDependency.js +6 -1
  71. package/lib/dependencies/CriticalDependencyWarning.js +0 -2
  72. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +11 -13
  73. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +2 -4
  74. package/lib/dependencies/HarmonyImportSpecifierDependency.js +4 -11
  75. package/lib/dependencies/ImportDependency.js +3 -3
  76. package/lib/dependencies/ImportParserPlugin.js +3 -4
  77. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +2 -3
  78. package/lib/dependencies/RequireEnsureDependency.js +3 -3
  79. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +0 -2
  80. package/lib/dependencies/SystemPlugin.js +0 -2
  81. package/lib/dependencies/WorkerDependency.js +6 -6
  82. package/lib/dependencies/WorkerPlugin.js +18 -19
  83. package/lib/errors/BuildCycleError.js +0 -1
  84. package/lib/hmr/LazyCompilationPlugin.js +9 -5
  85. package/lib/ids/HashedModuleIdsPlugin.js +3 -3
  86. package/lib/ids/OccurrenceModuleIdsPlugin.js +2 -3
  87. package/lib/index.js +5 -3
  88. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -6
  89. package/lib/javascript/CommonJsChunkFormatPlugin.js +2 -3
  90. package/lib/javascript/JavascriptGenerator.js +3 -1
  91. package/lib/javascript/JavascriptModulesPlugin.js +15 -23
  92. package/lib/javascript/JavascriptParser.js +10 -8
  93. package/lib/library/AssignLibraryPlugin.js +4 -2
  94. package/lib/node/NodeEnvironmentPlugin.js +1 -0
  95. package/lib/node/NodeWatchFileSystem.js +19 -4
  96. package/lib/optimize/AggressiveSplittingPlugin.js +5 -4
  97. package/lib/optimize/ConcatenatedModule.js +31 -27
  98. package/lib/optimize/FlagIncludedChunksPlugin.js +4 -6
  99. package/lib/optimize/InnerGraph.js +9 -11
  100. package/lib/optimize/InnerGraphPlugin.js +3 -1
  101. package/lib/optimize/ModuleConcatenationPlugin.js +7 -10
  102. package/lib/optimize/RealContentHashPlugin.js +14 -16
  103. package/lib/optimize/SideEffectsFlagPlugin.js +6 -5
  104. package/lib/optimize/SplitChunksPlugin.js +13 -15
  105. package/lib/performance/AssetsOverSizeLimitWarning.js +0 -2
  106. package/lib/performance/EntrypointsOverSizeLimitWarning.js +0 -2
  107. package/lib/performance/NoAsyncChunksWarning.js +0 -2
  108. package/lib/runtime/EnsureChunkRuntimeModule.js +9 -8
  109. package/lib/runtime/LoadScriptRuntimeModule.js +2 -3
  110. package/lib/runtime/OnChunksLoadedRuntimeModule.js +38 -37
  111. package/lib/schemes/DataUriPlugin.js +21 -2
  112. package/lib/serialization/BinaryMiddleware.js +5 -3
  113. package/lib/serialization/FileMiddleware.js +3 -1
  114. package/lib/serialization/ObjectMiddleware.js +11 -7
  115. package/lib/stats/DefaultStatsFactoryPlugin.js +7 -7
  116. package/lib/stats/DefaultStatsPrinterPlugin.js +11 -9
  117. package/lib/stats/StatsFactory.js +2 -1
  118. package/lib/stats/StatsPrinter.js +3 -3
  119. package/lib/util/LazyBucketSortedSet.js +3 -3
  120. package/lib/util/cleverMerge.js +3 -1
  121. package/lib/util/comparators.js +13 -13
  122. package/lib/util/createHash.js +5 -4
  123. package/lib/util/identifier.js +2 -1
  124. package/lib/util/serialization.js +108 -59
  125. package/lib/validateSchema.js +5 -3
  126. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +4 -4
  127. package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +0 -2
  128. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +5 -4
  129. package/lib/wasm-sync/WebAssemblyGenerator.js +89 -83
  130. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +0 -2
  131. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -1
  132. package/lib/wasm-sync/WebAssemblyParser.js +6 -5
  133. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -4
  134. package/lib/webpack.js +11 -7
  135. package/package.json +9 -6
  136. package/schemas/WebpackOptions.check.js +1 -1
  137. package/schemas/WebpackOptions.json +76 -60
  138. package/types.d.ts +112 -262
  139. package/lib/util/DataURI.js +0 -32
package/types.d.ts CHANGED
@@ -1830,6 +1830,7 @@ declare class Compiler {
1830
1830
  removedFiles: Set<string>;
1831
1831
  fileTimestamps: Map<string, null | FileSystemInfoEntry | "ignore">;
1832
1832
  contextTimestamps: Map<string, null | FileSystemInfoEntry | "ignore">;
1833
+ fsStartTime: number;
1833
1834
  resolverFactory: ResolverFactory;
1834
1835
  infrastructureLogger: any;
1835
1836
  options: WebpackOptionsNormalized;
@@ -2374,6 +2375,7 @@ declare interface ContextModuleOptions {
2374
2375
  include?: RegExp;
2375
2376
  exclude?: RegExp;
2376
2377
  groupOptions?: RawChunkGroupOptions;
2378
+ typePrefix?: string;
2377
2379
  category?: string;
2378
2380
 
2379
2381
  /**
@@ -3360,17 +3362,7 @@ declare abstract class ExportInfo {
3360
3362
  | "maybe provided (runtime-defined)"
3361
3363
  | "provided"
3362
3364
  | "not provided";
3363
- getRenameInfo():
3364
- | string
3365
- | "missing provision and use info prevents renaming"
3366
- | "usage prevents renaming (no provision info)"
3367
- | "missing provision info prevents renaming"
3368
- | "missing usage info prevents renaming"
3369
- | "usage prevents renaming"
3370
- | "could be renamed"
3371
- | "provision prevents renaming (no use info)"
3372
- | "usage and provision prevents renaming"
3373
- | "provision prevents renaming";
3365
+ getRenameInfo(): string;
3374
3366
  }
3375
3367
  declare interface ExportSpec {
3376
3368
  /**
@@ -5011,9 +5003,7 @@ declare class JavascriptParser extends Parser {
5011
5003
  parseCommentOptions(
5012
5004
  range?: any
5013
5005
  ): { options: null; errors: null } | { options: object; errors: any[] };
5014
- extractMemberExpressionChain(
5015
- expression: MemberExpression
5016
- ): {
5006
+ extractMemberExpressionChain(expression: MemberExpression): {
5017
5007
  members: string[];
5018
5008
  object:
5019
5009
  | UnaryExpression
@@ -5045,16 +5035,15 @@ declare class JavascriptParser extends Parser {
5045
5035
  | ChainExpression
5046
5036
  | Super;
5047
5037
  };
5048
- getFreeInfoFromVariable(
5049
- varName: string
5050
- ): { name: string; info: string | VariableInfo };
5038
+ getFreeInfoFromVariable(varName: string): {
5039
+ name: string;
5040
+ info: string | VariableInfo;
5041
+ };
5051
5042
  getMemberExpressionInfo(
5052
5043
  expression: MemberExpression,
5053
5044
  allowedTypes: number
5054
5045
  ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
5055
- getNameForExpression(
5056
- expression: MemberExpression
5057
- ): {
5046
+ getNameForExpression(expression: MemberExpression): {
5058
5047
  name: string;
5059
5048
  rootInfo: ExportedVariableInfo;
5060
5049
  getMembers: () => string[];
@@ -5805,13 +5794,11 @@ type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
5805
5794
  LoaderRunnerLoaderContext<OptionsType> &
5806
5795
  LoaderPluginLoaderContext &
5807
5796
  HotModuleReplacementPluginLoaderContext;
5808
- type LoaderDefinition<
5809
- OptionsType = {},
5810
- ContextAdditions = {}
5811
- > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
5812
- raw?: false;
5813
- pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
5814
- };
5797
+ type LoaderDefinition<OptionsType = {}, ContextAdditions = {}> =
5798
+ LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
5799
+ raw?: false;
5800
+ pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
5801
+ };
5815
5802
  declare interface LoaderDefinitionFunction<
5816
5803
  OptionsType = {},
5817
5804
  ContextAdditions = {}
@@ -7048,6 +7035,10 @@ declare class NormalModule extends Module {
7048
7035
  * path + query of the real resource
7049
7036
  */
7050
7037
  resource: string;
7038
+ /**
7039
+ * resource resolve data
7040
+ */
7041
+ resourceResolveData?: Record<string, any>;
7051
7042
  /**
7052
7043
  * path + query of the matched resource (virtual)
7053
7044
  */
@@ -7082,6 +7073,7 @@ declare class NormalModule extends Module {
7082
7073
  generator: Generator;
7083
7074
  generatorOptions: object;
7084
7075
  resource: string;
7076
+ resourceResolveData?: Record<string, any>;
7085
7077
  matchResource?: string;
7086
7078
  loaders: LoaderItem[];
7087
7079
  error?: WebpackError;
@@ -7197,9 +7189,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
7197
7189
  arg2?: ResolveRequest
7198
7190
  ) => void
7199
7191
  ): any;
7200
- getResolve(
7201
- options?: ResolveOptionsWithDependencyType
7202
- ): {
7192
+ getResolve(options?: ResolveOptionsWithDependencyType): {
7203
7193
  (
7204
7194
  context: string,
7205
7195
  request: string,
@@ -8671,13 +8661,11 @@ declare interface RawChunkGroupOptions {
8671
8661
  preloadOrder?: number;
8672
8662
  prefetchOrder?: number;
8673
8663
  }
8674
- type RawLoaderDefinition<
8675
- OptionsType = {},
8676
- ContextAdditions = {}
8677
- > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
8678
- raw: true;
8679
- pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
8680
- };
8664
+ type RawLoaderDefinition<OptionsType = {}, ContextAdditions = {}> =
8665
+ RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
8666
+ raw: true;
8667
+ pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
8668
+ };
8681
8669
  declare interface RawLoaderDefinitionFunction<
8682
8670
  OptionsType = {},
8683
8671
  ContextAdditions = {}
@@ -9308,61 +9296,72 @@ declare interface RuleSet {
9308
9296
  type RuleSetCondition =
9309
9297
  | string
9310
9298
  | RegExp
9311
- | {
9312
- /**
9313
- * Logical AND.
9314
- */
9315
- and?: RuleSetCondition[];
9316
- /**
9317
- * Logical NOT.
9318
- */
9319
- not?: RuleSetCondition[];
9320
- /**
9321
- * Logical OR.
9322
- */
9323
- or?: RuleSetCondition[];
9324
- }
9325
9299
  | ((value: string) => boolean)
9300
+ | RuleSetLogicalConditions
9326
9301
  | RuleSetCondition[];
9327
9302
  type RuleSetConditionAbsolute =
9328
9303
  | string
9329
9304
  | RegExp
9330
- | {
9331
- /**
9332
- * Logical AND.
9333
- */
9334
- and?: RuleSetConditionAbsolute[];
9335
- /**
9336
- * Logical NOT.
9337
- */
9338
- not?: RuleSetConditionAbsolute[];
9339
- /**
9340
- * Logical OR.
9341
- */
9342
- or?: RuleSetConditionAbsolute[];
9343
- }
9344
9305
  | ((value: string) => boolean)
9306
+ | RuleSetLogicalConditionsAbsolute
9345
9307
  | RuleSetConditionAbsolute[];
9346
9308
  type RuleSetConditionOrConditions =
9347
9309
  | string
9348
9310
  | RegExp
9349
- | {
9350
- /**
9351
- * Logical AND.
9352
- */
9353
- and?: RuleSetCondition[];
9354
- /**
9355
- * Logical NOT.
9356
- */
9357
- not?: RuleSetCondition[];
9358
- /**
9359
- * Logical OR.
9360
- */
9361
- or?: RuleSetCondition[];
9362
- }
9363
9311
  | ((value: string) => boolean)
9312
+ | RuleSetLogicalConditions
9364
9313
  | RuleSetCondition[];
9365
9314
 
9315
+ /**
9316
+ * Logic operators used in a condition matcher.
9317
+ */
9318
+ declare interface RuleSetLogicalConditions {
9319
+ /**
9320
+ * Logical AND.
9321
+ */
9322
+ and?: RuleSetCondition[];
9323
+
9324
+ /**
9325
+ * Logical NOT.
9326
+ */
9327
+ not?:
9328
+ | string
9329
+ | RegExp
9330
+ | ((value: string) => boolean)
9331
+ | RuleSetLogicalConditions
9332
+ | RuleSetCondition[];
9333
+
9334
+ /**
9335
+ * Logical OR.
9336
+ */
9337
+ or?: RuleSetCondition[];
9338
+ }
9339
+
9340
+ /**
9341
+ * Logic operators used in a condition matcher.
9342
+ */
9343
+ declare interface RuleSetLogicalConditionsAbsolute {
9344
+ /**
9345
+ * Logical AND.
9346
+ */
9347
+ and?: RuleSetConditionAbsolute[];
9348
+
9349
+ /**
9350
+ * Logical NOT.
9351
+ */
9352
+ not?:
9353
+ | string
9354
+ | RegExp
9355
+ | ((value: string) => boolean)
9356
+ | RuleSetLogicalConditionsAbsolute
9357
+ | RuleSetConditionAbsolute[];
9358
+
9359
+ /**
9360
+ * Logical OR.
9361
+ */
9362
+ or?: RuleSetConditionAbsolute[];
9363
+ }
9364
+
9366
9365
  /**
9367
9366
  * A rule description with conditions and effects for modules.
9368
9367
  */
@@ -9373,21 +9372,8 @@ declare interface RuleSetRule {
9373
9372
  compiler?:
9374
9373
  | string
9375
9374
  | RegExp
9376
- | {
9377
- /**
9378
- * Logical AND.
9379
- */
9380
- and?: RuleSetCondition[];
9381
- /**
9382
- * Logical NOT.
9383
- */
9384
- not?: RuleSetCondition[];
9385
- /**
9386
- * Logical OR.
9387
- */
9388
- or?: RuleSetCondition[];
9389
- }
9390
9375
  | ((value: string) => boolean)
9376
+ | RuleSetLogicalConditions
9391
9377
  | RuleSetCondition[];
9392
9378
 
9393
9379
  /**
@@ -9396,21 +9382,8 @@ declare interface RuleSetRule {
9396
9382
  dependency?:
9397
9383
  | string
9398
9384
  | RegExp
9399
- | {
9400
- /**
9401
- * Logical AND.
9402
- */
9403
- and?: RuleSetCondition[];
9404
- /**
9405
- * Logical NOT.
9406
- */
9407
- not?: RuleSetCondition[];
9408
- /**
9409
- * Logical OR.
9410
- */
9411
- or?: RuleSetCondition[];
9412
- }
9413
9385
  | ((value: string) => boolean)
9386
+ | RuleSetLogicalConditions
9414
9387
  | RuleSetCondition[];
9415
9388
 
9416
9389
  /**
@@ -9429,21 +9402,8 @@ declare interface RuleSetRule {
9429
9402
  exclude?:
9430
9403
  | string
9431
9404
  | RegExp
9432
- | {
9433
- /**
9434
- * Logical AND.
9435
- */
9436
- and?: RuleSetConditionAbsolute[];
9437
- /**
9438
- * Logical NOT.
9439
- */
9440
- not?: RuleSetConditionAbsolute[];
9441
- /**
9442
- * Logical OR.
9443
- */
9444
- or?: RuleSetConditionAbsolute[];
9445
- }
9446
9405
  | ((value: string) => boolean)
9406
+ | RuleSetLogicalConditionsAbsolute
9447
9407
  | RuleSetConditionAbsolute[];
9448
9408
 
9449
9409
  /**
@@ -9457,21 +9417,8 @@ declare interface RuleSetRule {
9457
9417
  include?:
9458
9418
  | string
9459
9419
  | RegExp
9460
- | {
9461
- /**
9462
- * Logical AND.
9463
- */
9464
- and?: RuleSetConditionAbsolute[];
9465
- /**
9466
- * Logical NOT.
9467
- */
9468
- not?: RuleSetConditionAbsolute[];
9469
- /**
9470
- * Logical OR.
9471
- */
9472
- or?: RuleSetConditionAbsolute[];
9473
- }
9474
9420
  | ((value: string) => boolean)
9421
+ | RuleSetLogicalConditionsAbsolute
9475
9422
  | RuleSetConditionAbsolute[];
9476
9423
 
9477
9424
  /**
@@ -9480,21 +9427,8 @@ declare interface RuleSetRule {
9480
9427
  issuer?:
9481
9428
  | string
9482
9429
  | RegExp
9483
- | {
9484
- /**
9485
- * Logical AND.
9486
- */
9487
- and?: RuleSetConditionAbsolute[];
9488
- /**
9489
- * Logical NOT.
9490
- */
9491
- not?: RuleSetConditionAbsolute[];
9492
- /**
9493
- * Logical OR.
9494
- */
9495
- or?: RuleSetConditionAbsolute[];
9496
- }
9497
9430
  | ((value: string) => boolean)
9431
+ | RuleSetLogicalConditionsAbsolute
9498
9432
  | RuleSetConditionAbsolute[];
9499
9433
 
9500
9434
  /**
@@ -9503,21 +9437,8 @@ declare interface RuleSetRule {
9503
9437
  issuerLayer?:
9504
9438
  | string
9505
9439
  | RegExp
9506
- | {
9507
- /**
9508
- * Logical AND.
9509
- */
9510
- and?: RuleSetCondition[];
9511
- /**
9512
- * Logical NOT.
9513
- */
9514
- not?: RuleSetCondition[];
9515
- /**
9516
- * Logical OR.
9517
- */
9518
- or?: RuleSetCondition[];
9519
- }
9520
9440
  | ((value: string) => boolean)
9441
+ | RuleSetLogicalConditions
9521
9442
  | RuleSetCondition[];
9522
9443
 
9523
9444
  /**
@@ -9536,21 +9457,8 @@ declare interface RuleSetRule {
9536
9457
  mimetype?:
9537
9458
  | string
9538
9459
  | RegExp
9539
- | {
9540
- /**
9541
- * Logical AND.
9542
- */
9543
- and?: RuleSetCondition[];
9544
- /**
9545
- * Logical NOT.
9546
- */
9547
- not?: RuleSetCondition[];
9548
- /**
9549
- * Logical OR.
9550
- */
9551
- or?: RuleSetCondition[];
9552
- }
9553
9460
  | ((value: string) => boolean)
9461
+ | RuleSetLogicalConditions
9554
9462
  | RuleSetCondition[];
9555
9463
 
9556
9464
  /**
@@ -9574,21 +9482,8 @@ declare interface RuleSetRule {
9574
9482
  realResource?:
9575
9483
  | string
9576
9484
  | RegExp
9577
- | {
9578
- /**
9579
- * Logical AND.
9580
- */
9581
- and?: RuleSetConditionAbsolute[];
9582
- /**
9583
- * Logical NOT.
9584
- */
9585
- not?: RuleSetConditionAbsolute[];
9586
- /**
9587
- * Logical OR.
9588
- */
9589
- or?: RuleSetConditionAbsolute[];
9590
- }
9591
9485
  | ((value: string) => boolean)
9486
+ | RuleSetLogicalConditionsAbsolute
9592
9487
  | RuleSetConditionAbsolute[];
9593
9488
 
9594
9489
  /**
@@ -9602,21 +9497,8 @@ declare interface RuleSetRule {
9602
9497
  resource?:
9603
9498
  | string
9604
9499
  | RegExp
9605
- | {
9606
- /**
9607
- * Logical AND.
9608
- */
9609
- and?: RuleSetConditionAbsolute[];
9610
- /**
9611
- * Logical NOT.
9612
- */
9613
- not?: RuleSetConditionAbsolute[];
9614
- /**
9615
- * Logical OR.
9616
- */
9617
- or?: RuleSetConditionAbsolute[];
9618
- }
9619
9500
  | ((value: string) => boolean)
9501
+ | RuleSetLogicalConditionsAbsolute
9620
9502
  | RuleSetConditionAbsolute[];
9621
9503
 
9622
9504
  /**
@@ -9625,21 +9507,8 @@ declare interface RuleSetRule {
9625
9507
  resourceFragment?:
9626
9508
  | string
9627
9509
  | RegExp
9628
- | {
9629
- /**
9630
- * Logical AND.
9631
- */
9632
- and?: RuleSetCondition[];
9633
- /**
9634
- * Logical NOT.
9635
- */
9636
- not?: RuleSetCondition[];
9637
- /**
9638
- * Logical OR.
9639
- */
9640
- or?: RuleSetCondition[];
9641
- }
9642
9510
  | ((value: string) => boolean)
9511
+ | RuleSetLogicalConditions
9643
9512
  | RuleSetCondition[];
9644
9513
 
9645
9514
  /**
@@ -9648,21 +9517,8 @@ declare interface RuleSetRule {
9648
9517
  resourceQuery?:
9649
9518
  | string
9650
9519
  | RegExp
9651
- | {
9652
- /**
9653
- * Logical AND.
9654
- */
9655
- and?: RuleSetCondition[];
9656
- /**
9657
- * Logical NOT.
9658
- */
9659
- not?: RuleSetCondition[];
9660
- /**
9661
- * Logical OR.
9662
- */
9663
- or?: RuleSetCondition[];
9664
- }
9665
9520
  | ((value: string) => boolean)
9521
+ | RuleSetLogicalConditions
9666
9522
  | RuleSetCondition[];
9667
9523
 
9668
9524
  /**
@@ -9670,6 +9526,16 @@ declare interface RuleSetRule {
9670
9526
  */
9671
9527
  rules?: RuleSetRule[];
9672
9528
 
9529
+ /**
9530
+ * Match module scheme.
9531
+ */
9532
+ scheme?:
9533
+ | string
9534
+ | RegExp
9535
+ | ((value: string) => boolean)
9536
+ | RuleSetLogicalConditions
9537
+ | RuleSetCondition[];
9538
+
9673
9539
  /**
9674
9540
  * Flags a module as with or without side effects.
9675
9541
  */
@@ -9681,21 +9547,8 @@ declare interface RuleSetRule {
9681
9547
  test?:
9682
9548
  | string
9683
9549
  | RegExp
9684
- | {
9685
- /**
9686
- * Logical AND.
9687
- */
9688
- and?: RuleSetConditionAbsolute[];
9689
- /**
9690
- * Logical NOT.
9691
- */
9692
- not?: RuleSetConditionAbsolute[];
9693
- /**
9694
- * Logical OR.
9695
- */
9696
- or?: RuleSetConditionAbsolute[];
9697
- }
9698
9550
  | ((value: string) => boolean)
9551
+ | RuleSetLogicalConditionsAbsolute
9699
9552
  | RuleSetConditionAbsolute[];
9700
9553
 
9701
9554
  /**
@@ -9730,9 +9583,7 @@ declare interface RuleSetRule {
9730
9583
  */
9731
9584
  options?: string | { [index: string]: any };
9732
9585
  }
9733
- | ((
9734
- data: object
9735
- ) =>
9586
+ | ((data: object) =>
9736
9587
  | string
9737
9588
  | {
9738
9589
  /**
@@ -11617,8 +11468,9 @@ declare abstract class Watching {
11617
11468
  };
11618
11469
  compiler: Compiler;
11619
11470
  running: boolean;
11620
- watcher: any;
11621
- pausedWatcher: any;
11471
+ watcher?: null | Watcher;
11472
+ pausedWatcher?: null | Watcher;
11473
+ lastWatcherStartTime?: number;
11622
11474
  watch(
11623
11475
  files: Iterable<string>,
11624
11476
  dirs: Iterable<string>,
@@ -11923,9 +11775,7 @@ declare interface WithOptions {
11923
11775
  declare interface WriteOnlySet<T> {
11924
11776
  add: (T?: any) => void;
11925
11777
  }
11926
- type __TypeWebpackOptions = (
11927
- data: object
11928
- ) =>
11778
+ type __TypeWebpackOptions = (data: object) =>
11929
11779
  | string
11930
11780
  | {
11931
11781
  /**
@@ -11948,14 +11798,14 @@ declare function exports(
11948
11798
  callback?: CallbackWebpack<Stats>
11949
11799
  ): Compiler;
11950
11800
  declare function exports(
11951
- options: Configuration[] & MultiCompilerOptions,
11801
+ options: ReadonlyArray<Configuration> & MultiCompilerOptions,
11952
11802
  callback?: CallbackWebpack<MultiStats>
11953
11803
  ): MultiCompiler;
11954
11804
  declare namespace exports {
11955
11805
  export const webpack: {
11956
11806
  (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
11957
11807
  (
11958
- options: Configuration[] & MultiCompilerOptions,
11808
+ options: ReadonlyArray<Configuration> & MultiCompilerOptions,
11959
11809
  callback?: CallbackWebpack<MultiStats>
11960
11810
  ): MultiCompiler;
11961
11811
  };
@@ -12250,19 +12100,19 @@ declare namespace exports {
12250
12100
  ) => 0 | 1 | -1;
12251
12101
  }
12252
12102
  export namespace serialization {
12253
- export let register: (
12103
+ export const register: (
12254
12104
  Constructor: Constructor,
12255
12105
  request: string,
12256
12106
  name: string,
12257
12107
  serializer: ObjectSerializer
12258
12108
  ) => void;
12259
- export let registerLoader: (
12109
+ export const registerLoader: (
12260
12110
  regExp: RegExp,
12261
12111
  loader: (arg0: string) => boolean
12262
12112
  ) => void;
12263
- export let registerNotSerializable: (Constructor: Constructor) => void;
12264
- export let NOT_SERIALIZABLE: object;
12265
- export let buffersSerializer: Serializer;
12113
+ export const registerNotSerializable: (Constructor: Constructor) => void;
12114
+ export const NOT_SERIALIZABLE: object;
12115
+ export const buffersSerializer: Serializer;
12266
12116
  export let createFileSerializer: (fs?: any) => Serializer;
12267
12117
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
12268
12118
  }
@@ -1,32 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- */
4
-
5
- "use strict";
6
-
7
- // data URL scheme: "data:text/javascript;charset=utf-8;base64,some-string"
8
- // http://www.ietf.org/rfc/rfc2397.txt
9
- const URIRegEx = /^data:([^;,]+)?((?:;(?:[^;,]+))*?)(;base64)?,(.*)$/i;
10
-
11
- const decodeDataURI = uri => {
12
- const match = URIRegEx.exec(uri);
13
- if (!match) return null;
14
-
15
- const isBase64 = match[3];
16
- const body = match[4];
17
- return isBase64
18
- ? Buffer.from(body, "base64")
19
- : Buffer.from(decodeURIComponent(body), "ascii");
20
- };
21
-
22
- const getMimetype = uri => {
23
- const match = URIRegEx.exec(uri);
24
- if (!match) return "";
25
-
26
- return match[1] || "text/plain";
27
- };
28
-
29
- module.exports = {
30
- decodeDataURI,
31
- getMimetype
32
- };