@plaudit/webpack-extensions 2.56.0 → 2.56.2

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.
@@ -134,7 +134,7 @@ class PlainEntrypointsConfigFileGeneratorPlugin {
134
134
  finalHandleName = handleName;
135
135
  }
136
136
  else {
137
- const basename = node_path_1.default.basename(src).replace(/_(?:script|style)(?:-\d+)?\.(?:css|js)$/, "");
137
+ const basename = node_path_1.default.basename(src).replace(/_(?:script(?:-\d+)?\.js|style(?:-\d+)?\.css)$|(?<!_(script|style))\.(js|css)$/, "");
138
138
  const baseFinalHandleName = `${handlePrefix}.${kebabCase(basename)}`;
139
139
  const handleNameMap = (isScript ? usedScriptHandleNames : usedStyleHandleNames);
140
140
  finalHandleName = baseFinalHandleName;
@@ -46,7 +46,7 @@ class PseudoSemaphore {
46
46
  controller.resolve = resolve;
47
47
  controller.reject = reject;
48
48
  });
49
- this.flags.set(id, [promise, controller, false, Date.now()]);
49
+ this.flags.set(id, [promise, controller, false]);
50
50
  this.flagSet++;
51
51
  promise.catch(() => { });
52
52
  }
@@ -55,7 +55,7 @@ class PseudoSemaphore {
55
55
  let res;
56
56
  do {
57
57
  currentFlagSet = this.flagSet;
58
- res = await Promise.all(this.flags.values().toArray().sort((a, b) => a[3] - b[3]).map(flag => flag[0]));
58
+ res = await Promise.all(this.flags.values().map(flag => flag[0]));
59
59
  } while (currentFlagSet !== this.flagSet);
60
60
  return res;
61
61
  }
@@ -268,10 +268,9 @@ function finalizeEntryDestination(entry, dynamicEffectiveDestinationsWithExpecte
268
268
  if (entry[1].staticallyDeclaredDestination) {
269
269
  return entry;
270
270
  }
271
- //TODO: Maybe try to figure out a way to avoid generated handles unnecessarily including "_script" and "_style"
272
271
  const extension = node_path_1.default.extname(entry[1].destination);
273
272
  const filename = dynamicEffectiveDestinationsWithExpectedNaiveDuplicates[entry[1].effectiveDestination]
274
- ? entry[1].effectiveDestination + (extension === '.css' ? "_script" : "_style")
273
+ ? entry[1].effectiveDestination + (extension === '.css' ? "_style" : "_script")
275
274
  : entry[1].effectiveDestination;
276
275
  let count = 0, derivedDestination = filename + extension;
277
276
  while (derivedDestination in allocatedDestinations && allocatedDestinations[derivedDestination] !== entry[0]) {
@@ -414,7 +413,6 @@ function commonConfigProcessingPrep(config, webpackConfig) {
414
413
  updateCurrentVariables: (value) => currentVariables = value
415
414
  };
416
415
  }
417
- //TODO: Implement path deduplication w/ the same code we use for block.json (only for plain v2 w/ specified handles
418
416
  //TODO: Try using context to avoid needing to cobble dest paths together?
419
417
  function processIndividualWebpackConfig(config, webpackConfig, sources) {
420
418
  const commonConfig = commonConfigProcessingPrep(config, webpackConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.56.0",
3
+ "version": "2.56.2",
4
4
  "license": "UNLICENSED",
5
5
  "files": [
6
6
  "/build"