@plaudit/webpack-extensions 3.12.2 → 3.12.4
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.4] - 2026-07-07
|
|
9
|
+
### Fixed
|
|
10
|
+
- The output missing a blank line after the global hooks
|
|
11
|
+
|
|
12
|
+
## [3.12.3] - 2026-07-07
|
|
13
|
+
### Fixed
|
|
14
|
+
- `admin` hooks that were not restricted to an individual page being restricted to only being emitted on non-existent pages
|
|
15
|
+
|
|
8
16
|
## [3.12.2] - 2026-06-23
|
|
9
17
|
### Fixed
|
|
10
18
|
- The nice name handling re-breaking for plain entrypoints
|
|
@@ -200,11 +200,17 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
|
|
|
200
200
|
for (const [priority, prioritizedHandleList] of PlainEntrypointsConfigFileGeneratorPlugin.separateHandleListByPriority(handleList)) {
|
|
201
201
|
if (supports_hook_name) {
|
|
202
202
|
const hookNamedHandleLists = PlainEntrypointsConfigFileGeneratorPlugin.separateHandleListByHookName(prioritizedHandleList);
|
|
203
|
-
if (
|
|
203
|
+
if (hookNamedHandleLists.named.length > 0) {
|
|
204
204
|
const hook_name_var = new expressions_1.Var("hook_name", "?string");
|
|
205
205
|
writer.action(action, writer => {
|
|
206
206
|
additional_action_code?.before?.(writer);
|
|
207
|
-
|
|
207
|
+
if (hookNamedHandleLists.global) {
|
|
208
|
+
for (const handle of hookNamedHandleLists.global) {
|
|
209
|
+
writer.call(`wp_enqueue_${handle.type}`, [handle.handle]);
|
|
210
|
+
}
|
|
211
|
+
writer.linebreak();
|
|
212
|
+
}
|
|
213
|
+
for (const [hook_name, handles] of hookNamedHandleLists.named) {
|
|
208
214
|
writer.if(expressions_1.Op.binary(hook_name_var, " === ", hook_name));
|
|
209
215
|
for (const handle of handles) {
|
|
210
216
|
writer.call(`wp_enqueue_${handle.type}`, [handle.handle]);
|
|
@@ -247,9 +253,16 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
|
|
|
247
253
|
* @private
|
|
248
254
|
*/
|
|
249
255
|
static separateHandleListByHookName(handleItems) {
|
|
256
|
+
const global = [];
|
|
250
257
|
const lists = new Map();
|
|
251
258
|
for (const handleItem of handleItems) {
|
|
252
259
|
const hook_name = handleItem.hook_name ?? "";
|
|
260
|
+
if (hook_name === "" || (Array.isArray(hook_name) && hook_name.includes(""))) {
|
|
261
|
+
// We're going to be handling global hooks (aka those without a name restriction) separately anyway,
|
|
262
|
+
// so there's no sense in mixing them in with the non-global ones
|
|
263
|
+
global.push(handleItem);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
253
266
|
for (const hn of Array.isArray(hook_name) ? hook_name : [hook_name]) {
|
|
254
267
|
const list = lists.get(hn);
|
|
255
268
|
if (list) {
|
|
@@ -260,15 +273,7 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
|
|
|
260
273
|
}
|
|
261
274
|
}
|
|
262
275
|
}
|
|
263
|
-
return lists.entries().toArray().sort((a, b) =>
|
|
264
|
-
if (a[0] === "") {
|
|
265
|
-
return b[0] === "" ? 0 : -1;
|
|
266
|
-
}
|
|
267
|
-
else if (b[0] === "") {
|
|
268
|
-
return 1;
|
|
269
|
-
}
|
|
270
|
-
return a[0].localeCompare(b[0]);
|
|
271
|
-
});
|
|
276
|
+
return { global, named: lists.entries().toArray().sort((a, b) => a[0].localeCompare(b[0])) };
|
|
272
277
|
}
|
|
273
278
|
attachUniquePhase(compilation) {
|
|
274
279
|
compilation.hooks.processAssets.tapPromise({ name: this.constructor.name, stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_REPORT }, async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaudit/webpack-extensions",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.4",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"files": [
|
|
6
6
|
"/dist",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@plaudit/postcss-color-function": "^5.1.0",
|
|
47
47
|
"@plaudit/postcss-strip-units": "^3.0.0",
|
|
48
48
|
"@plaudit/postcss-variables": "^2.0.1",
|
|
49
|
-
"@wordpress/dependency-extraction-webpack-plugin": "^6.
|
|
50
|
-
"@wordpress/scripts": "^32.
|
|
51
|
-
"autoprefixer": "^10.5.
|
|
49
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.50.0",
|
|
50
|
+
"@wordpress/scripts": "^32.6.0",
|
|
51
|
+
"autoprefixer": "^10.5.2",
|
|
52
52
|
"browser-sync": "^3.0.4",
|
|
53
53
|
"copy-webpack-plugin": "10.2.4",
|
|
54
54
|
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"http-proxy-middleware": "^3.0.7",
|
|
58
58
|
"jsdom": "^29.1.1",
|
|
59
59
|
"json2php": "^0.0.12",
|
|
60
|
-
"postcss": "^8.5.
|
|
60
|
+
"postcss": "^8.5.16",
|
|
61
61
|
"postcss-calc": "^10.1.1",
|
|
62
62
|
"postcss-functions": "^4.0.2",
|
|
63
63
|
"postcss-import": "^16.1.1",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"postcss-property-lookup": "^3.0.0",
|
|
68
68
|
"postcss-reporter": "^7.1.0",
|
|
69
69
|
"postcss-url": "^10.1.4",
|
|
70
|
-
"webpack": "^5.
|
|
70
|
+
"webpack": "^5.108.4",
|
|
71
71
|
"webpack-remove-empty-scripts": "^1.1.1",
|
|
72
72
|
"xml-formatter": "^3.7.0"
|
|
73
73
|
},
|