webpack 5.108.0 → 5.108.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.
@@ -1218,7 +1218,7 @@ class RuntimeTemplate {
1218
1218
  "Can't inline the exports of defer imported module"
1219
1219
  );
1220
1220
  }
1221
- const access = `${importVar}.a${propertyAccess(used)}`;
1221
+ const access = `${importVar}.a${propertyAccess(Array.isArray(used) ? used : [used])}`;
1222
1222
  if (isCall || asiSafe === undefined) {
1223
1223
  return access;
1224
1224
  }
@@ -1313,7 +1313,7 @@ class RuntimeTemplate {
1313
1313
  : `${Template.toNormalComment(propertyAccess(exportName))} `;
1314
1314
  const access = `${importVar}${
1315
1315
  isModuleDeferred ? ".a" : ""
1316
- }${comment}${propertyAccess(used)}`;
1316
+ }${comment}${propertyAccess(Array.isArray(used) ? used : [used])}`;
1317
1317
  if (isCall && callContext === false) {
1318
1318
  return asiSafe
1319
1319
  ? `(0,${access})`
@@ -1417,7 +1417,7 @@ class RuntimeTemplate {
1417
1417
  if (used[used.length - 1] !== exportInfo.name) mangled = true;
1418
1418
  definitions.push(
1419
1419
  `${propertyName(exportInfo.name)}: ${this.returningFunction(
1420
- `${importVar}${propertyAccess(used)}`
1420
+ `${importVar}${propertyAccess(/** @type {string[]} */ (used))}`
1421
1421
  )}`
1422
1422
  );
1423
1423
  }
@@ -208,13 +208,24 @@ const createTrace = (fs, outputPath) => {
208
208
  }
209
209
  });
210
210
 
211
+ // Chrome DevTools treats this as the primary trace-bootstrap event and
212
+ // iterates `args.data.frames`; it must be present or the trace fails to load.
211
213
  trace.instantEvent({
212
214
  name: "TracingStartedInBrowser",
213
215
  id: ++counter,
214
216
  cat: ["disabled-by-default-devtools.timeline"],
215
217
  args: {
216
218
  data: {
217
- sessionId: "-1"
219
+ sessionId: "-1",
220
+ frameTreeNodeId: 1,
221
+ persistentIds: true,
222
+ frames: [
223
+ {
224
+ frame: "0xfff",
225
+ url: "webpack",
226
+ name: ""
227
+ }
228
+ ]
218
229
  }
219
230
  }
220
231
  });
@@ -462,7 +462,7 @@ CommonJsExportRequireDependency.Template = class CommonJsExportRequireDependency
462
462
  const comment = equals(usedImported, ids)
463
463
  ? ""
464
464
  : `${Template.toNormalComment(propertyAccess(ids))} `;
465
- requireExpr += `${comment}${propertyAccess(usedImported)}`;
465
+ requireExpr += `${comment}${propertyAccess(/** @type {string[]} */ (usedImported))}`;
466
466
  }
467
467
  }
468
468
  }
@@ -473,7 +473,7 @@ CommonJsExportRequireDependency.Template = class CommonJsExportRequireDependency
473
473
  dep.range[0],
474
474
  dep.range[1] - 1,
475
475
  used
476
- ? `${base}${propertyAccess(used)} = ${requireExpr}`
476
+ ? `${base}${propertyAccess(/** @type {string[]} */ (used))} = ${requireExpr}`
477
477
  : `/* unused reexport */ ${requireExpr}`
478
478
  );
479
479
  return;
@@ -501,7 +501,7 @@ CommonJsExportRequireDependency.Template = class CommonJsExportRequireDependency
501
501
  dep.range[0],
502
502
  valueRange[0] - 1,
503
503
  `Object.defineProperty(${base}${propertyAccess(
504
- used.slice(0, -1)
504
+ /** @type {string[]} */ (used).slice(0, -1)
505
505
  )}, ${JSON.stringify(used[used.length - 1])}, { ${descriptor}`
506
506
  );
507
507
  source.replace(valueRange[0], valueRange[1] - 1, requireExpr);
@@ -149,7 +149,7 @@ CommonJsExportsDependency.Template = class CommonJsExportsDependencyTemplate ext
149
149
  source.replace(
150
150
  dep.range[0],
151
151
  dep.range[1] - 1,
152
- `${base}${propertyAccess(used)}`
152
+ `${base}${propertyAccess(/** @type {string[]} */ (used))}`
153
153
  );
154
154
  return;
155
155
  case "Object.defineProperty":
@@ -178,7 +178,7 @@ CommonJsExportsDependency.Template = class CommonJsExportsDependencyTemplate ext
178
178
  dep.range[0],
179
179
  /** @type {Range} */ (dep.valueRange)[0] - 1,
180
180
  `Object.defineProperty(${base}${propertyAccess(
181
- used.slice(0, -1)
181
+ /** @type {string[]} */ (used).slice(0, -1)
182
182
  )}, ${JSON.stringify(used[used.length - 1])}, (`
183
183
  );
184
184
  source.replace(
@@ -178,7 +178,7 @@ CommonJsFullRequireDependency.Template = class CommonJsFullRequireDependencyTemp
178
178
  const comment = equals(usedImported, trimmedIds)
179
179
  ? ""
180
180
  : `${Template.toNormalComment(propertyAccess(trimmedIds))} `;
181
- const access = `${comment}${propertyAccess(usedImported)}`;
181
+ const access = `${comment}${propertyAccess(/** @type {string[]} */ (usedImported))}`;
182
182
  requireExpr =
183
183
  dep.asiSafe === true
184
184
  ? `(${requireExpr}${access})`
@@ -161,7 +161,7 @@ CommonJsSelfReferenceDependency.Template = class CommonJsSelfReferenceDependency
161
161
  source.replace(
162
162
  dep.range[0],
163
163
  dep.range[1] - 1,
164
- `${base}${propertyAccess(used)}`
164
+ `${base}${propertyAccess(/** @type {string[]} */ (used))}`
165
165
  );
166
166
  }
167
167
  };
@@ -1667,7 +1667,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
1667
1667
  );
1668
1668
  }
1669
1669
 
1670
- return `${name}${propertyAccess(valueKey)}`;
1670
+ return `${name}${propertyAccess(Array.isArray(valueKey) ? valueKey : [valueKey])}`;
1671
1671
  }
1672
1672
  };
1673
1673
 
@@ -146,7 +146,7 @@ class ProvidedDependencyTemplate extends ModuleDependency.Template {
146
146
  `inlined export ${propertyAccess(dep.ids)}`
147
147
  )
148
148
  )})`
149
- : `${moduleRaw}${propertyAccess(usedName, 0)}`;
149
+ : `${moduleRaw}${propertyAccess(/** @type {string[]} */ (usedName), 0)}`;
150
150
 
151
151
  initFragments.push(
152
152
  new InitFragment(
@@ -2110,7 +2110,7 @@ class ConcatenatedModule extends Module {
2110
2110
  `\n ${propertyName(exportInfo.name)}: ${runtimeTemplate.returningFunction(
2111
2111
  usedName.render(
2112
2112
  Template.toNormalComment(
2113
- `inlined export ${propertyAccess(exportInfo.name)}`
2113
+ `inlined export ${propertyAccess([exportInfo.name])}`
2114
2114
  )
2115
2115
  )
2116
2116
  )}`
@@ -2120,7 +2120,7 @@ class ConcatenatedModule extends Module {
2120
2120
  // import variable; concatenated ones resolve to an internal binding.
2121
2121
  const finalName =
2122
2122
  info.type === "external"
2123
- ? `${/** @type {string} */ (info.name)}${propertyAccess(usedName)}`
2123
+ ? `${/** @type {string} */ (info.name)}${propertyAccess([usedName])}`
2124
2124
  : getFinalName(
2125
2125
  moduleGraph,
2126
2126
  info,
@@ -2183,7 +2183,7 @@ ${defineGetters}`
2183
2183
  `\n ${propertyName(exportInfo.name)}: ${runtimeTemplate.returningFunction(
2184
2184
  usedName.render(
2185
2185
  Template.toNormalComment(
2186
- `inlined export ${propertyAccess(exportInfo.name)}`
2186
+ `inlined export ${propertyAccess([exportInfo.name])}`
2187
2187
  )
2188
2188
  )
2189
2189
  )}`
@@ -75,7 +75,7 @@ const propertyName = (prop) => {
75
75
 
76
76
  /**
77
77
  * Returns chain of property accesses.
78
- * @param {ArrayLike<string>} properties properties
78
+ * @param {readonly string[]} properties properties
79
79
  * @param {number} start start index
80
80
  * @returns {string} chain of property accesses
81
81
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.108.0",
3
+ "version": "5.108.1",
4
4
  "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
5
5
  "homepage": "https://github.com/webpack/webpack",
6
6
  "bugs": "https://github.com/webpack/webpack/issues",
@@ -182,6 +182,7 @@
182
182
  "prettier-2": "npm:prettier@^2",
183
183
  "pretty-format": "^30.0.5",
184
184
  "pug": "^3.0.3",
185
+ "puppeteer-core": "^23.11.1",
185
186
  "raw-loader": "^4.0.1",
186
187
  "react": "^19.2.7",
187
188
  "react-dom": "^19.2.7",