webpack 5.89.0 → 5.90.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 (167) hide show
  1. package/README.md +3 -0
  2. package/bin/webpack.js +1 -3
  3. package/hot/log.js +0 -2
  4. package/lib/APIPlugin.js +17 -13
  5. package/lib/ChunkGraph.js +1 -1
  6. package/lib/CleanPlugin.js +12 -12
  7. package/lib/Compilation.js +26 -17
  8. package/lib/Compiler.js +13 -0
  9. package/lib/ConcatenationScope.js +2 -2
  10. package/lib/ConditionalInitFragment.js +3 -3
  11. package/lib/ContextModule.js +4 -4
  12. package/lib/ContextModuleFactory.js +1 -1
  13. package/lib/DefinePlugin.js +47 -26
  14. package/lib/DependencyTemplate.js +3 -1
  15. package/lib/EnvironmentNotSupportAsyncWarning.js +52 -0
  16. package/lib/EvalDevToolModulePlugin.js +1 -1
  17. package/lib/EvalSourceMapDevToolPlugin.js +2 -2
  18. package/lib/ExportsInfoApiPlugin.js +2 -2
  19. package/lib/ExternalModule.js +47 -12
  20. package/lib/ExternalModuleFactoryPlugin.js +1 -1
  21. package/lib/FileSystemInfo.js +20 -3
  22. package/lib/FlagDependencyExportsPlugin.js +1 -1
  23. package/lib/Generator.js +1 -0
  24. package/lib/HotModuleReplacementPlugin.js +3 -3
  25. package/lib/InitFragment.js +7 -7
  26. package/lib/LibManifestPlugin.js +4 -1
  27. package/lib/Module.js +2 -1
  28. package/lib/ModuleFilenameHelpers.js +1 -1
  29. package/lib/ModuleInfoHeaderPlugin.js +1 -1
  30. package/lib/MultiStats.js +2 -2
  31. package/lib/NodeStuffPlugin.js +48 -0
  32. package/lib/NormalModule.js +13 -11
  33. package/lib/NormalModuleFactory.js +7 -7
  34. package/lib/RuntimeTemplate.js +15 -11
  35. package/lib/SourceMapDevToolPlugin.js +2 -2
  36. package/lib/Stats.js +4 -0
  37. package/lib/WebpackOptionsApply.js +4 -3
  38. package/lib/asset/AssetModulesPlugin.js +2 -3
  39. package/lib/async-modules/AwaitDependenciesInitFragment.js +2 -2
  40. package/lib/buildChunkGraph.js +53 -0
  41. package/lib/cache/AddManagedPathsPlugin.js +6 -1
  42. package/lib/cache/IdleFileCachePlugin.js +12 -5
  43. package/lib/cache/PackFileCacheStrategy.js +3 -3
  44. package/lib/cache/ResolverCachePlugin.js +2 -2
  45. package/lib/config/browserslistTargetHandler.js +35 -14
  46. package/lib/config/defaults.js +88 -52
  47. package/lib/config/normalization.js +17 -18
  48. package/lib/config/target.js +5 -0
  49. package/lib/container/ContainerReferencePlugin.js +1 -1
  50. package/lib/css/CssExportsGenerator.js +14 -1
  51. package/lib/css/CssGenerator.js +14 -1
  52. package/lib/css/CssLoadingRuntimeModule.js +23 -23
  53. package/lib/css/CssModulesPlugin.js +68 -32
  54. package/lib/css/CssParser.js +8 -3
  55. package/lib/debug/ProfilingPlugin.js +2 -2
  56. package/lib/dependencies/AMDDefineDependency.js +4 -4
  57. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +126 -34
  58. package/lib/dependencies/AMDPlugin.js +11 -4
  59. package/lib/dependencies/AMDRequireArrayDependency.js +13 -1
  60. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +159 -43
  61. package/lib/dependencies/AMDRequireDependency.js +2 -2
  62. package/lib/dependencies/AMDRequireItemDependency.js +1 -1
  63. package/lib/dependencies/CachedConstDependency.js +8 -1
  64. package/lib/dependencies/CommonJsImportsParserPlugin.js +1 -1
  65. package/lib/dependencies/ContextElementDependency.js +1 -1
  66. package/lib/dependencies/ExternalModuleDependency.js +107 -0
  67. package/lib/dependencies/ExternalModuleInitFragment.js +131 -0
  68. package/lib/dependencies/HarmonyAcceptDependency.js +1 -1
  69. package/lib/dependencies/HarmonyDetectionParserPlugin.js +7 -1
  70. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +18 -18
  71. package/lib/dependencies/HarmonyExportInitFragment.js +6 -6
  72. package/lib/dependencies/HarmonyImportDependency.js +4 -4
  73. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +6 -6
  74. package/lib/dependencies/ImportDependency.js +26 -6
  75. package/lib/dependencies/JsonExportsDependency.js +1 -1
  76. package/lib/dependencies/LoaderPlugin.js +2 -1
  77. package/lib/dependencies/LocalModuleDependency.js +1 -1
  78. package/lib/dependencies/PureExpressionDependency.js +12 -4
  79. package/lib/dependencies/RequireIncludeDependency.js +1 -1
  80. package/lib/dependencies/WebpackIsIncludedDependency.js +1 -1
  81. package/lib/dependencies/WorkerPlugin.js +10 -3
  82. package/lib/dependencies/getFunctionExpression.js +2 -2
  83. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +6 -6
  84. package/lib/hmr/HotModuleReplacement.runtime.js +3 -5
  85. package/lib/hmr/lazyCompilationBackend.js +4 -4
  86. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
  87. package/lib/index.js +4 -0
  88. package/lib/javascript/JavascriptGenerator.js +16 -1
  89. package/lib/javascript/JavascriptModulesPlugin.js +33 -33
  90. package/lib/javascript/JavascriptParser.js +220 -74
  91. package/lib/json/JsonGenerator.js +1 -1
  92. package/lib/library/AmdLibraryPlugin.js +5 -1
  93. package/lib/library/AssignLibraryPlugin.js +1 -1
  94. package/lib/library/SystemLibraryPlugin.js +1 -1
  95. package/lib/library/UmdLibraryPlugin.js +39 -39
  96. package/lib/logging/createConsoleLogger.js +1 -19
  97. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +8 -8
  98. package/lib/node/RequireChunkLoadingRuntimeModule.js +8 -8
  99. package/lib/node/nodeConsole.js +1 -5
  100. package/lib/optimize/ConcatenatedModule.js +7 -7
  101. package/lib/optimize/InnerGraphPlugin.js +9 -1
  102. package/lib/optimize/MangleExportsPlugin.js +5 -1
  103. package/lib/optimize/ModuleConcatenationPlugin.js +2 -2
  104. package/lib/optimize/RemoveParentModulesPlugin.js +123 -47
  105. package/lib/optimize/SideEffectsFlagPlugin.js +15 -3
  106. package/lib/optimize/SplitChunksPlugin.js +16 -16
  107. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +2 -2
  108. package/lib/rules/RuleSetCompiler.js +1 -1
  109. package/lib/runtime/AutoPublicPathRuntimeModule.js +2 -2
  110. package/lib/runtime/GetChunkFilenameRuntimeModule.js +4 -4
  111. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +4 -4
  112. package/lib/runtime/LoadScriptRuntimeModule.js +2 -2
  113. package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +23 -22
  114. package/lib/runtime/StartupEntrypointRuntimeModule.js +2 -2
  115. package/lib/schemes/HttpUriPlugin.js +1 -1
  116. package/lib/serialization/FileMiddleware.js +4 -4
  117. package/lib/serialization/ObjectMiddleware.js +4 -4
  118. package/lib/sharing/ConsumeSharedPlugin.js +5 -5
  119. package/lib/sharing/ConsumeSharedRuntimeModule.js +8 -4
  120. package/lib/sharing/ProvideSharedModule.js +2 -2
  121. package/lib/sharing/SharePlugin.js +2 -2
  122. package/lib/sharing/ShareRuntimeModule.js +1 -1
  123. package/lib/sharing/utils.js +24 -28
  124. package/lib/stats/DefaultStatsFactoryPlugin.js +10 -10
  125. package/lib/stats/DefaultStatsPresetPlugin.js +3 -7
  126. package/lib/stats/DefaultStatsPrinterPlugin.js +34 -31
  127. package/lib/util/chainedImports.js +7 -6
  128. package/lib/util/cleverMerge.js +4 -4
  129. package/lib/util/comparators.js +59 -23
  130. package/lib/util/hash/xxhash64.js +2 -2
  131. package/lib/util/identifier.js +2 -2
  132. package/lib/util/internalSerializables.js +6 -0
  133. package/lib/util/numberHash.js +64 -52
  134. package/lib/util/runtime.js +18 -1
  135. package/lib/util/semver.js +19 -24
  136. package/lib/util/smartGrouping.js +1 -1
  137. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +53 -28
  138. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +2 -2
  139. package/lib/wasm-async/AsyncWebAssemblyParser.js +6 -0
  140. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
  141. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +2 -2
  142. package/lib/web/JsonpChunkLoadingRuntimeModule.js +13 -13
  143. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +6 -6
  144. package/package.json +25 -80
  145. package/schemas/WebpackOptions.check.js +1 -1
  146. package/schemas/WebpackOptions.json +140 -32
  147. package/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts +7 -0
  148. package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +6 -0
  149. package/schemas/plugins/css/CssAutoGeneratorOptions.json +3 -0
  150. package/schemas/plugins/css/CssAutoParserOptions.check.d.ts +7 -0
  151. package/schemas/plugins/css/CssAutoParserOptions.check.js +6 -0
  152. package/schemas/plugins/css/CssAutoParserOptions.json +3 -0
  153. package/schemas/plugins/css/CssGeneratorOptions.check.js +1 -1
  154. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts +7 -0
  155. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +6 -0
  156. package/schemas/plugins/css/CssGlobalGeneratorOptions.json +3 -0
  157. package/schemas/plugins/css/CssGlobalParserOptions.check.d.ts +7 -0
  158. package/schemas/plugins/css/CssGlobalParserOptions.check.js +6 -0
  159. package/schemas/plugins/css/CssGlobalParserOptions.json +3 -0
  160. package/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts +7 -0
  161. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +6 -0
  162. package/schemas/plugins/css/CssModuleGeneratorOptions.json +3 -0
  163. package/schemas/plugins/css/CssModuleParserOptions.check.d.ts +7 -0
  164. package/schemas/plugins/css/CssModuleParserOptions.check.js +6 -0
  165. package/schemas/plugins/css/CssModuleParserOptions.json +3 -0
  166. package/schemas/plugins/css/CssParserOptions.check.js +1 -1
  167. package/types.d.ts +273 -94
@@ -102,6 +102,10 @@ class RuntimeTemplate {
102
102
  return this.outputOptions.environment.arrowFunction;
103
103
  }
104
104
 
105
+ supportsAsyncFunction() {
106
+ return this.outputOptions.environment.asyncFunction;
107
+ }
108
+
105
109
  supportsOptionalChaining() {
106
110
  return this.outputOptions.environment.optionalChaining;
107
111
  }
@@ -222,7 +226,7 @@ class RuntimeTemplate {
222
226
  ? `var [${items.join(", ")}] = ${value};`
223
227
  : Template.asString(
224
228
  items.map((item, i) => `var ${item} = ${value}[${i}];`)
225
- );
229
+ );
226
230
  }
227
231
 
228
232
  destructureObject(items, value) {
@@ -230,7 +234,7 @@ class RuntimeTemplate {
230
234
  ? `var {${items.join(", ")}} = ${value};`
231
235
  : Template.asString(
232
236
  items.map(item => `var ${item} = ${value}${propertyAccess([item])};`)
233
- );
237
+ );
234
238
  }
235
239
 
236
240
  iife(args, body) {
@@ -242,7 +246,7 @@ class RuntimeTemplate {
242
246
  ? `for(const ${variable} of ${array}) {\n${Template.indent(body)}\n}`
243
247
  : `${array}.forEach(function(${variable}) {\n${Template.indent(
244
248
  body
245
- )}\n});`;
249
+ )}\n});`;
246
250
  }
247
251
 
248
252
  /**
@@ -343,10 +347,10 @@ class RuntimeTemplate {
343
347
  moduleId === null
344
348
  ? JSON.stringify("Module is not available (weak dependency)")
345
349
  : idExpr
346
- ? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
347
- : JSON.stringify(
348
- `Module '${moduleId}' is not available (weak dependency)`
349
- );
350
+ ? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
351
+ : JSON.stringify(
352
+ `Module '${moduleId}' is not available (weak dependency)`
353
+ );
350
354
  const comment = request ? Template.toNormalComment(request) + " " : "";
351
355
  const errorStatements =
352
356
  `var e = new Error(${errorMessage}); ` +
@@ -840,8 +844,8 @@ class RuntimeTemplate {
840
844
  return asiSafe
841
845
  ? `(${importVar}_default()${propertyAccess(exportName, 1)})`
842
846
  : asiSafe === false
843
- ? `;(${importVar}_default()${propertyAccess(exportName, 1)})`
844
- : `${importVar}_default.a${propertyAccess(exportName, 1)}`;
847
+ ? `;(${importVar}_default()${propertyAccess(exportName, 1)})`
848
+ : `${importVar}_default.a${propertyAccess(exportName, 1)}`;
845
849
  }
846
850
  case "default-only":
847
851
  case "default-with-named":
@@ -898,8 +902,8 @@ class RuntimeTemplate {
898
902
  return asiSafe
899
903
  ? `(0,${access})`
900
904
  : asiSafe === false
901
- ? `;(0,${access})`
902
- : `/*#__PURE__*/Object(${access})`;
905
+ ? `;(0,${access})`
906
+ : `/*#__PURE__*/Object(${access})`;
903
907
  }
904
908
  return access;
905
909
  } else {
@@ -486,7 +486,7 @@ class SourceMapDevToolPlugin {
486
486
  outputFs,
487
487
  `/${options.fileContext}`,
488
488
  `/${filename}`
489
- )
489
+ )
490
490
  : filename,
491
491
  contentHash: sourceMapContentHash
492
492
  };
@@ -501,7 +501,7 @@ class SourceMapDevToolPlugin {
501
501
  outputFs,
502
502
  dirname(outputFs, `/${file}`),
503
503
  `/${sourceMapFile}`
504
- );
504
+ );
505
505
  /** @type {Source} */
506
506
  let asset = new RawSource(source);
507
507
  if (currentSourceMappingURLComment !== false) {
package/lib/Stats.js CHANGED
@@ -65,6 +65,10 @@ class Stats {
65
65
  });
66
66
  }
67
67
 
68
+ /**
69
+ * @param {(string|StatsOptions)=} options stats options
70
+ * @returns {string} string output
71
+ */
68
72
  toString(options) {
69
73
  options = this.compilation.createStatsOptions(options, {
70
74
  forToString: true
@@ -307,7 +307,7 @@ class WebpackOptionsApply extends OptionsApply {
307
307
 
308
308
  if (options.experiments.css) {
309
309
  const CssModulesPlugin = require("./css/CssModulesPlugin");
310
- new CssModulesPlugin(options.experiments.css).apply(compiler);
310
+ new CssModulesPlugin().apply(compiler);
311
311
  }
312
312
 
313
313
  if (options.experiments.lazyCompilation) {
@@ -329,7 +329,7 @@ class WebpackOptionsApply extends OptionsApply {
329
329
  options.externalsPresets.node ? "node" : "web"
330
330
  }.js`
331
331
  )
332
- }),
332
+ }),
333
333
  entries: !lazyOptions || lazyOptions.entries !== false,
334
334
  imports: !lazyOptions || lazyOptions.imports !== false,
335
335
  test: (lazyOptions && lazyOptions.test) || undefined
@@ -588,7 +588,8 @@ class WebpackOptionsApply extends OptionsApply {
588
588
  const AddManagedPathsPlugin = require("./cache/AddManagedPathsPlugin");
589
589
  new AddManagedPathsPlugin(
590
590
  options.snapshot.managedPaths,
591
- options.snapshot.immutablePaths
591
+ options.snapshot.immutablePaths,
592
+ options.snapshot.unmanagedPaths
592
593
  ).apply(compiler);
593
594
 
594
595
  if (options.cache && typeof options.cache === "object") {
@@ -208,9 +208,8 @@ class AssetModulesPlugin {
208
208
  codeGenResult.data.get("fullContentHash")
209
209
  });
210
210
  } catch (e) {
211
- /** @type {Error} */ (
212
- e
213
- ).message += `\nduring rendering of asset ${module.identifier()}`;
211
+ /** @type {Error} */ (e).message +=
212
+ `\nduring rendering of asset ${module.identifier()}`;
214
213
  throw e;
215
214
  }
216
215
  }
@@ -42,8 +42,8 @@ class AwaitDependenciesInitFragment extends InitFragment {
42
42
  }
43
43
 
44
44
  /**
45
- * @param {Context} context context
46
- * @returns {string|Source} the source code that will be included as initialization code
45
+ * @param {GenerateContext} context context
46
+ * @returns {string | Source} the source code that will be included as initialization code
47
47
  */
48
48
  getContent({ runtimeRequirements }) {
49
49
  runtimeRequirements.add(RuntimeGlobals.module);
@@ -266,12 +266,18 @@ const visitModules = (
266
266
  /** @type {Map<DependenciesBlock, ChunkGroupInfo>} */
267
267
  const blockChunkGroups = new Map();
268
268
 
269
+ /** @type {Map<ChunkGroupInfo, DependenciesBlock>} */
270
+ const blockByChunkGroups = new Map();
271
+
269
272
  /** @type {Map<string, ChunkGroupInfo>} */
270
273
  const namedChunkGroups = new Map();
271
274
 
272
275
  /** @type {Map<string, ChunkGroupInfo>} */
273
276
  const namedAsyncEntrypoints = new Map();
274
277
 
278
+ /** @type {Set<ChunkGroupInfo>} */
279
+ const outdatedOrderIndexChunkGroups = new Set();
280
+
275
281
  const ADD_AND_ENTER_ENTRY_MODULE = 0;
276
282
  const ADD_AND_ENTER_MODULE = 1;
277
283
  const ENTER_MODULE = 2;
@@ -524,6 +530,7 @@ const visitModules = (
524
530
  blockConnections.set(b, []);
525
531
  }
526
532
  blockChunkGroups.set(b, /** @type {ChunkGroupInfo} */ (cgi));
533
+ blockByChunkGroups.set(cgi, b);
527
534
  } else if (entryOptions) {
528
535
  entrypoint = /** @type {Entrypoint} */ (cgi.chunkGroup);
529
536
  } else {
@@ -1208,6 +1215,7 @@ const visitModules = (
1208
1215
  chunkGroupsForCombining.add(cgi);
1209
1216
  }
1210
1217
  }
1218
+ outdatedOrderIndexChunkGroups.add(info);
1211
1219
  }
1212
1220
  outdatedChunkGroupInfo.clear();
1213
1221
  };
@@ -1254,6 +1262,51 @@ const visitModules = (
1254
1262
  }
1255
1263
  }
1256
1264
 
1265
+ for (const info of outdatedOrderIndexChunkGroups) {
1266
+ const { chunkGroup, runtime } = info;
1267
+
1268
+ const block = blockByChunkGroups.get(info);
1269
+
1270
+ if (!block) {
1271
+ continue;
1272
+ }
1273
+
1274
+ let preOrderIndex = 0;
1275
+ let postOrderIndex = 0;
1276
+
1277
+ const process = (current, visited = new Set()) => {
1278
+ if (visited.has(current)) {
1279
+ return;
1280
+ }
1281
+
1282
+ visited.add(current);
1283
+
1284
+ const blockModules = getBlockModules(current, runtime);
1285
+ if (blockModules === undefined) {
1286
+ return;
1287
+ }
1288
+
1289
+ for (let i = 0; i < blockModules.length; i += 2) {
1290
+ const refModule = /** @type {Module} */ (blockModules[i]);
1291
+ const activeState = /** @type {ConnectionState} */ (
1292
+ blockModules[i + 1]
1293
+ );
1294
+ if (activeState === false) {
1295
+ continue;
1296
+ }
1297
+
1298
+ if (refModule) {
1299
+ chunkGroup.setModulePreOrderIndex(refModule, preOrderIndex++);
1300
+ process(refModule, visited);
1301
+ chunkGroup.setModulePostOrderIndex(refModule, postOrderIndex++);
1302
+ }
1303
+ }
1304
+ };
1305
+
1306
+ process(block);
1307
+ }
1308
+ outdatedOrderIndexChunkGroups.clear();
1309
+
1257
1310
  logger.log(
1258
1311
  `${statProcessedQueueItems} queue items processed (${statProcessedBlocks} blocks)`
1259
1312
  );
@@ -11,10 +11,12 @@ class AddManagedPathsPlugin {
11
11
  /**
12
12
  * @param {Iterable<string | RegExp>} managedPaths list of managed paths
13
13
  * @param {Iterable<string | RegExp>} immutablePaths list of immutable paths
14
+ * @param {Iterable<string | RegExp>} unmanagedPaths list of unmanaged paths
14
15
  */
15
- constructor(managedPaths, immutablePaths) {
16
+ constructor(managedPaths, immutablePaths, unmanagedPaths) {
16
17
  this.managedPaths = new Set(managedPaths);
17
18
  this.immutablePaths = new Set(immutablePaths);
19
+ this.unmanagedPaths = new Set(unmanagedPaths);
18
20
  }
19
21
 
20
22
  /**
@@ -29,6 +31,9 @@ class AddManagedPathsPlugin {
29
31
  for (const immutablePath of this.immutablePaths) {
30
32
  compiler.immutablePaths.add(immutablePath);
31
33
  }
34
+ for (const unmanagedPath of this.unmanagedPaths) {
35
+ compiler.unmanagedPaths.add(unmanagedPath);
36
+ }
32
37
  }
33
38
  }
34
39
 
@@ -199,11 +199,18 @@ class IdleFileCachePlugin {
199
199
  }s.`
200
200
  );
201
201
  }
202
- idleTimer = setTimeout(() => {
203
- idleTimer = undefined;
204
- isIdle = true;
205
- resolvedPromise.then(processIdleTasks);
206
- }, Math.min(isInitialStore ? idleTimeoutForInitialStore : Infinity, isLargeChange ? idleTimeoutAfterLargeChanges : Infinity, idleTimeout));
202
+ idleTimer = setTimeout(
203
+ () => {
204
+ idleTimer = undefined;
205
+ isIdle = true;
206
+ resolvedPromise.then(processIdleTasks);
207
+ },
208
+ Math.min(
209
+ isInitialStore ? idleTimeoutForInitialStore : Infinity,
210
+ isLargeChange ? idleTimeoutAfterLargeChanges : Infinity,
211
+ idleTimeout
212
+ )
213
+ );
207
214
  idleTimer.unref();
208
215
  }
209
216
  );
@@ -539,7 +539,7 @@ class Pack {
539
539
  map.set(identifier, content.content.get(identifier));
540
540
  }
541
541
  return new PackContentItems(map);
542
- })
542
+ })
543
543
  : undefined;
544
544
  }
545
545
  }
@@ -1046,8 +1046,8 @@ class PackFileCacheStrategy {
1046
1046
  compression === "brotli"
1047
1047
  ? ".pack.br"
1048
1048
  : compression === "gzip"
1049
- ? ".pack.gz"
1050
- : ".pack";
1049
+ ? ".pack.gz"
1050
+ : ".pack";
1051
1051
  this.snapshot = snapshot;
1052
1052
  /** @type {Set<string>} */
1053
1053
  this.buildDependencies = new Set();
@@ -264,7 +264,7 @@ class ResolverCachePlugin {
264
264
  yields = undefined;
265
265
  callbacks = false;
266
266
  }
267
- }
267
+ }
268
268
  : (err, result) => {
269
269
  if (callbacks === undefined) {
270
270
  callback(err, result);
@@ -276,7 +276,7 @@ class ResolverCachePlugin {
276
276
  activeRequests.delete(identifier);
277
277
  callbacks = false;
278
278
  }
279
- };
279
+ };
280
280
  /**
281
281
  * @param {Error=} err error if any
282
282
  * @param {CacheEntry=} cacheEntry cache entry
@@ -60,11 +60,11 @@ const load = (input, context) => {
60
60
  const config = query
61
61
  ? query
62
62
  : configPath
63
- ? browserslist.loadConfig({
64
- config: configPath,
65
- env
66
- })
67
- : browserslist.loadConfig({ path: context, env });
63
+ ? browserslist.loadConfig({
64
+ config: configPath,
65
+ env
66
+ })
67
+ : browserslist.loadConfig({ path: context, env });
68
68
 
69
69
  if (!config) return;
70
70
  return browserslist(config);
@@ -90,7 +90,9 @@ const resolve = browsers => {
90
90
  // safari TP supports all features for normal safari
91
91
  parsedVersion === "TP"
92
92
  ? [Infinity, Infinity]
93
- : parsedVersion.split(".");
93
+ : parsedVersion.includes("-")
94
+ ? parsedVersion.split("-")[0].split(".")
95
+ : parsedVersion.split(".");
94
96
  if (typeof requiredVersion === "number") {
95
97
  return +parsedMajor >= requiredVersion;
96
98
  }
@@ -118,8 +120,8 @@ const resolve = browsers => {
118
120
  samsung: [8, 2],
119
121
  android: 63,
120
122
  and_qq: [10, 4],
121
- // baidu: Not supported
122
- // and_uc: Not supported
123
+ baidu: [13, 18],
124
+ and_uc: [15, 5],
123
125
  kaios: [3, 0],
124
126
  node: [12, 17]
125
127
  });
@@ -144,7 +146,7 @@ const resolve = browsers => {
144
146
  android: 37,
145
147
  and_qq: [10, 4],
146
148
  // Supported correctly in strict mode, otherwise supported without block scope
147
- // baidu: Not supported
149
+ baidu: [13, 18],
148
150
  and_uc: [12, 12],
149
151
  kaios: [2, 5],
150
152
  node: [6, 0]
@@ -222,9 +224,9 @@ const resolve = browsers => {
222
224
  ios_saf: 14,
223
225
  samsung: [9, 2],
224
226
  android: 67,
225
- // and_qq: Not supported
226
- // baidu: Not supported
227
- // and_uc: Not supported
227
+ and_qq: [13, 1],
228
+ baidu: [13, 18],
229
+ and_uc: [15, 5],
228
230
  kaios: [3, 0],
229
231
  node: [10, 4]
230
232
  }),
@@ -244,8 +246,8 @@ const resolve = browsers => {
244
246
  samsung: [8, 0],
245
247
  android: 61,
246
248
  and_qq: [10, 4],
247
- // baidu: Not supported
248
- // and_uc: Not supported
249
+ baidu: [13, 18],
250
+ and_uc: [15, 5],
249
251
  kaios: [3, 0],
250
252
  node: [12, 17]
251
253
  }),
@@ -310,6 +312,25 @@ const resolve = browsers => {
310
312
  kaios: [2, 5],
311
313
  node: 4
312
314
  }),
315
+ asyncFunction: rawChecker({
316
+ chrome: 55,
317
+ and_chr: 55,
318
+ edge: 15,
319
+ firefox: 52,
320
+ and_ff: 52,
321
+ // ie: Not supported,
322
+ opera: 42,
323
+ op_mob: 42,
324
+ safari: 11,
325
+ ios_saf: 11,
326
+ samsung: [6, 2],
327
+ android: 55,
328
+ and_qq: [13, 1],
329
+ baidu: [13, 18],
330
+ and_uc: [15, 5],
331
+ kaios: 3,
332
+ node: [7, 6]
333
+ }),
313
334
  browser: browserProperty,
314
335
  electron: false,
315
336
  node: nodeProperty,