webpack 5.37.1 → 5.39.1

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 (68) hide show
  1. package/bin/webpack.js +20 -5
  2. package/lib/AsyncDependencyToInitialChunkError.js +0 -2
  3. package/lib/CaseSensitiveModulesWarning.js +0 -2
  4. package/lib/Chunk.js +6 -2
  5. package/lib/ChunkRenderError.js +0 -2
  6. package/lib/CodeGenerationError.js +0 -2
  7. package/lib/CommentCompilationWarning.js +0 -2
  8. package/lib/Compilation.js +43 -28
  9. package/lib/Compiler.js +3 -0
  10. package/lib/ConcurrentCompilationError.js +0 -2
  11. package/lib/ContextModule.js +2 -1
  12. package/lib/ContextModuleFactory.js +3 -1
  13. package/lib/DllReferencePlugin.js +0 -2
  14. package/lib/EntryPlugin.js +3 -3
  15. package/lib/ExportsInfo.js +20 -13
  16. package/lib/HarmonyLinkingError.js +0 -2
  17. package/lib/HookWebpackError.js +0 -1
  18. package/lib/HotModuleReplacementPlugin.js +7 -2
  19. package/lib/InvalidDependenciesModuleWarning.js +0 -2
  20. package/lib/ModuleBuildError.js +0 -2
  21. package/lib/ModuleDependencyError.js +0 -2
  22. package/lib/ModuleDependencyWarning.js +0 -2
  23. package/lib/ModuleError.js +0 -2
  24. package/lib/ModuleNotFoundError.js +0 -2
  25. package/lib/ModuleParseError.js +0 -2
  26. package/lib/ModuleRestoreError.js +0 -2
  27. package/lib/ModuleStoreError.js +0 -2
  28. package/lib/ModuleWarning.js +0 -2
  29. package/lib/NoModeWarning.js +0 -2
  30. package/lib/NormalModule.js +4 -3
  31. package/lib/NormalModuleFactory.js +2 -0
  32. package/lib/UnsupportedFeatureWarning.js +0 -2
  33. package/lib/WarnDeprecatedOptionPlugin.js +0 -2
  34. package/lib/Watching.js +21 -14
  35. package/lib/WebpackError.js +0 -2
  36. package/lib/asset/AssetGenerator.js +27 -6
  37. package/lib/asset/AssetModulesPlugin.js +1 -1
  38. package/lib/cache/PackFileCacheStrategy.js +3 -0
  39. package/lib/config/defaults.js +9 -1
  40. package/lib/config/normalization.js +1 -0
  41. package/lib/config/target.js +7 -2
  42. package/lib/dependencies/ContextElementDependency.js +6 -1
  43. package/lib/dependencies/CriticalDependencyWarning.js +0 -2
  44. package/lib/dependencies/ImportParserPlugin.js +1 -0
  45. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +0 -2
  46. package/lib/dependencies/SystemPlugin.js +0 -2
  47. package/lib/errors/BuildCycleError.js +0 -1
  48. package/lib/hmr/LazyCompilationPlugin.js +3 -1
  49. package/lib/node/NodeEnvironmentPlugin.js +1 -0
  50. package/lib/optimize/ConcatenatedModule.js +9 -0
  51. package/lib/performance/AssetsOverSizeLimitWarning.js +0 -2
  52. package/lib/performance/EntrypointsOverSizeLimitWarning.js +0 -2
  53. package/lib/performance/NoAsyncChunksWarning.js +0 -2
  54. package/lib/schemes/DataUriPlugin.js +21 -2
  55. package/lib/serialization/BinaryMiddleware.js +3 -0
  56. package/lib/serialization/SerializerMiddleware.js +19 -0
  57. package/lib/stats/DefaultStatsFactoryPlugin.js +5 -4
  58. package/lib/util/ArrayQueue.js +8 -0
  59. package/lib/util/AsyncQueue.js +9 -0
  60. package/lib/util/createHash.js +5 -4
  61. package/lib/util/serialization.js +108 -59
  62. package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +0 -2
  63. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +0 -2
  64. package/package.json +4 -4
  65. package/schemas/WebpackOptions.check.js +1 -1
  66. package/schemas/WebpackOptions.json +8 -0
  67. package/types.d.ts +24 -5
  68. package/lib/util/DataURI.js +0 -32
@@ -3728,6 +3728,14 @@
3728
3728
  ]
3729
3729
  }
3730
3730
  },
3731
+ "scheme": {
3732
+ "description": "Match module scheme.",
3733
+ "oneOf": [
3734
+ {
3735
+ "$ref": "#/definitions/RuleSetConditionOrConditions"
3736
+ }
3737
+ ]
3738
+ },
3731
3739
  "sideEffects": {
3732
3740
  "description": "Flags a module as with or without side effects.",
3733
3741
  "type": "boolean"
package/types.d.ts CHANGED
@@ -358,6 +358,7 @@ declare abstract class AsyncQueue<T, K, R> {
358
358
  isProcessing(item: T): boolean;
359
359
  isQueued(item: T): boolean;
360
360
  isDone(item: T): boolean;
361
+ clear(): void;
361
362
  }
362
363
  declare class AsyncWebAssemblyModulesPlugin {
363
364
  constructor(options?: any);
@@ -1830,6 +1831,7 @@ declare class Compiler {
1830
1831
  removedFiles: Set<string>;
1831
1832
  fileTimestamps: Map<string, null | FileSystemInfoEntry | "ignore">;
1832
1833
  contextTimestamps: Map<string, null | FileSystemInfoEntry | "ignore">;
1834
+ fsStartTime: number;
1833
1835
  resolverFactory: ResolverFactory;
1834
1836
  infrastructureLogger: any;
1835
1837
  options: WebpackOptionsNormalized;
@@ -2374,6 +2376,7 @@ declare interface ContextModuleOptions {
2374
2376
  include?: RegExp;
2375
2377
  exclude?: RegExp;
2376
2378
  groupOptions?: RawChunkGroupOptions;
2379
+ typePrefix?: string;
2377
2380
  category?: string;
2378
2381
 
2379
2382
  /**
@@ -7033,6 +7036,10 @@ declare class NormalModule extends Module {
7033
7036
  * path + query of the real resource
7034
7037
  */
7035
7038
  resource: string;
7039
+ /**
7040
+ * resource resolve data
7041
+ */
7042
+ resourceResolveData?: Record<string, any>;
7036
7043
  /**
7037
7044
  * path + query of the matched resource (virtual)
7038
7045
  */
@@ -7067,6 +7074,7 @@ declare class NormalModule extends Module {
7067
7074
  generator: Generator;
7068
7075
  generatorOptions: object;
7069
7076
  resource: string;
7077
+ resourceResolveData?: Record<string, any>;
7070
7078
  matchResource?: string;
7071
7079
  loaders: LoaderItem[];
7072
7080
  error?: WebpackError;
@@ -9519,6 +9527,16 @@ declare interface RuleSetRule {
9519
9527
  */
9520
9528
  rules?: RuleSetRule[];
9521
9529
 
9530
+ /**
9531
+ * Match module scheme.
9532
+ */
9533
+ scheme?:
9534
+ | string
9535
+ | RegExp
9536
+ | ((value: string) => boolean)
9537
+ | RuleSetLogicalConditions
9538
+ | RuleSetCondition[];
9539
+
9522
9540
  /**
9523
9541
  * Flags a module as with or without side effects.
9524
9542
  */
@@ -11453,6 +11471,7 @@ declare abstract class Watching {
11453
11471
  running: boolean;
11454
11472
  watcher?: null | Watcher;
11455
11473
  pausedWatcher?: null | Watcher;
11474
+ lastWatcherStartTime?: number;
11456
11475
  watch(
11457
11476
  files: Iterable<string>,
11458
11477
  dirs: Iterable<string>,
@@ -12082,19 +12101,19 @@ declare namespace exports {
12082
12101
  ) => 0 | 1 | -1;
12083
12102
  }
12084
12103
  export namespace serialization {
12085
- export let register: (
12104
+ export const register: (
12086
12105
  Constructor: Constructor,
12087
12106
  request: string,
12088
12107
  name: string,
12089
12108
  serializer: ObjectSerializer
12090
12109
  ) => void;
12091
- export let registerLoader: (
12110
+ export const registerLoader: (
12092
12111
  regExp: RegExp,
12093
12112
  loader: (arg0: string) => boolean
12094
12113
  ) => void;
12095
- export let registerNotSerializable: (Constructor: Constructor) => void;
12096
- export let NOT_SERIALIZABLE: object;
12097
- export let buffersSerializer: Serializer;
12114
+ export const registerNotSerializable: (Constructor: Constructor) => void;
12115
+ export const NOT_SERIALIZABLE: object;
12116
+ export const buffersSerializer: Serializer;
12098
12117
  export let createFileSerializer: (fs?: any) => Serializer;
12099
12118
  export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
12100
12119
  }
@@ -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
- };