@plaudit/webpack-extensions 3.12.3 → 3.12.5

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.12.5] - 2026-07-07
9
+ ### Fixed
10
+ - `PlainEntrypointsConfigFileGeneratorPlugin` not handling niceName-based handles correctly
11
+
12
+ ## [3.12.4] - 2026-07-07
13
+ ### Fixed
14
+ - The output missing a blank line after the global hooks
15
+
8
16
  ## [3.12.3] - 2026-07-07
9
17
  ### Fixed
10
18
  - `admin` hooks that were not restricted to an individual page being restricted to only being emitted on non-existent pages
@@ -30,14 +30,7 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
30
30
  inline: [],
31
31
  ...Object.fromEntries((0, shared_1.constantKeys)(shared_1.standardLocationNamesMeta).map(sln => [sln, []]))
32
32
  };
33
- const allNamedHandles = assets
34
- .flatMap(({ handles }) => handles)
35
- .filter((handle) => !!handle.handleName)
36
- .sort((a, b) => a.src.localeCompare(b.src));
37
- const usedHandleNames = Object.fromEntries(['script', 'script_module', 'style']
38
- .map(type => [type, Object.fromEntries(allNamedHandles
39
- .filter(handle => handle.type === 'script')
40
- .map(handle => [handle.handleName, handle.src]))]));
33
+ const usedHandleNames = { script: {}, script_module: {}, style: {} };
41
34
  const plainEntrypointsConfig = { scriptHandles: {}, script_moduleHandles: {}, styleHandles: {} };
42
35
  for (const { handles, handlePrefix } of assets) {
43
36
  for (const { src, rest, locations, type, handleName, lazyLoader, ...otherProps } of handles) {
@@ -51,9 +44,7 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
51
44
  if (typeof handleName === 'string' || typeof handleName === 'function' || (handleName && 'niceName' in handleName)) {
52
45
  finalHandleName = (0, shared_1.convertUsageLocationsHandleToEmittableHandle)(handleName, handlePrefix, finalHandleName.substring(handlePrefix.length + 1));
53
46
  }
54
- else {
55
- handleNameMap[finalHandleName] = src;
56
- }
47
+ handleNameMap[finalHandleName] = src;
57
48
  plainEntrypointsConfig[`${type}Handles`][finalHandleName] = { src, rest, locations, type, lazyLoader, ...otherProps };
58
49
  }
59
50
  }
@@ -204,8 +195,11 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
204
195
  const hook_name_var = new expressions_1.Var("hook_name", "?string");
205
196
  writer.action(action, writer => {
206
197
  additional_action_code?.before?.(writer);
207
- for (const handle of hookNamedHandleLists.global) {
208
- writer.call(`wp_enqueue_${handle.type}`, [handle.handle]);
198
+ if (hookNamedHandleLists.global) {
199
+ for (const handle of hookNamedHandleLists.global) {
200
+ writer.call(`wp_enqueue_${handle.type}`, [handle.handle]);
201
+ }
202
+ writer.linebreak();
209
203
  }
210
204
  for (const [hook_name, handles] of hookNamedHandleLists.named) {
211
205
  writer.if(expressions_1.Op.binary(hook_name_var, " === ", hook_name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "3.12.3",
3
+ "version": "3.12.5",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/dist",