@plaudit/webpack-extensions 2.73.0 → 2.73.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.
@@ -18,11 +18,14 @@ class ExtensionsConfigFileGeneratorPluginV1 extends AbstractBiPhasicGroupAndEntr
18
18
  }
19
19
  attachUniquePhase() { }
20
20
  processAssets(compilation, assetsJson) {
21
- const regex = /^(.+?)-((?:editor-|view-|)(?:style|script|script-module))\.(?:css|m?js)$/i;
21
+ const regex = /^(.+?)-((?<prefix>editor-|view-|)(?<type>style|script|script-module))\.(?<extension>css|m?js)$/i;
22
22
  const mapping = {};
23
- for (const fileWithAssetData of Object.keys(this.extractRelevantAssetData(compilation, assetsJson))) {
23
+ for (let fileWithAssetData of Object.keys(this.extractRelevantAssetData(compilation, assetsJson))) {
24
24
  let match;
25
25
  if ((match = regex.exec(fileWithAssetData)) && match[1] && match[2]) {
26
+ if (match.groups?.['type'] === 'style' && match.groups['extension'] !== 'css') {
27
+ fileWithAssetData = fileWithAssetData.replace(/\.m?js$/i, ".css");
28
+ }
26
29
  const resourceInfo = (mapping[match[1]] ?? (mapping[match[1]] = [{}]))[0];
27
30
  const key = match[2].replace(/-[sm]/gi, chars => chars.substring(1).toUpperCase());
28
31
  (resourceInfo[key] ?? (resourceInfo[key] = [])).push([`plaudit_block-extension_${match[1]}-${match[2]}`, fileWithAssetData]);
@@ -88,17 +88,6 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
88
88
  }
89
89
  }, { priority, accountForAlreadyDoing: this.config.includePostInitFallback });
90
90
  }
91
- const sortedEditorStyleHandles = sortedStyleHandles
92
- .filter(([_, { locations: { clientEditor }, type }]) => type === 'style' && (clientEditor || typeof clientEditor === 'number'))
93
- .map(info => info[1]);
94
- if (sortedEditorStyleHandles.length > 0) {
95
- writer.linebreak();
96
- const themePath = process.cwd();
97
- for (const handleData of sortedEditorStyleHandles) {
98
- const handlePath = node_path_1.default.relative(themePath, handleData.src);
99
- writer.call("add_editor_style", [(0, shared_1.leadingSlashIt)(handlePath)]);
100
- }
101
- }
102
91
  }
103
92
  PlainEntrypointsConfigFileGeneratorPlugin.appendEnqueuingHandleLists(writer, handleLists);
104
93
  (0, shared_1.emitPHPWriterAsAsset)(writer, compilation, "plain-entrypoints-loader.php");
@@ -109,11 +98,6 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
109
98
  handleLists.register.push({ handle, type, data, priority: typeof data.locations.register === 'number' ? data.locations.register : 10 });
110
99
  }
111
100
  for (const location of (0, shared_1.constantKeys)(shared_1.standardLocationNamesMeta)) {
112
- if (location === 'clientEditor' && type === 'style') {
113
- // We don't include editor styles in the handle list because editor styles are enqueued via a completely separate mechanism at runtime and, therefore,
114
- // cannot be handled by the same code as every other enqueueable item
115
- continue;
116
- }
117
101
  if (typeof data.locations[location] === 'number') {
118
102
  handleLists[location].push({ handle, type, priority: data.locations[location] });
119
103
  }
package/build/shared.js CHANGED
@@ -165,7 +165,7 @@ function emitResolveBaseUriFunction(writer) {
165
165
  .call("error_log", ["UNABLE TO FIGURE OUT WHAT THE RELATIVE PATH TO THE BUILT FILES DIRECTORY SHOULD BE"])
166
166
  .assign(path, "")
167
167
  .endIf()
168
- .call("trailingslashit", [expressions_1.Expr.call("home_url", [path])], { return: true, assignTo: assignmentTarget });
168
+ .call("trailingslashit", [expressions_1.Expr.call("get_site_url", [new expressions_1.Argument(path, "path")])], { return: true, assignTo: assignmentTarget });
169
169
  }, { returnType: "string", includeExistenceCheck: true });
170
170
  }
171
171
  function getAssetsJson(compilation) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.73.0",
3
+ "version": "2.73.2",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/build"
@@ -20,31 +20,30 @@
20
20
  }
21
21
  },
22
22
  "devDependencies": {
23
- "@plaudit/gutenberg-api-extensions": "^2.78.1",
23
+ "@plaudit/gutenberg-api-extensions": "^2.79.0",
24
24
  "@types/browser-sync-webpack-plugin": "^2.2.5",
25
- "@types/node": "^24.9.2",
25
+ "@types/node": "^24.10.1",
26
26
  "@types/postcss-functions": "^4.0.4",
27
27
  "@types/tapable": "^2.3.0",
28
28
  "@types/webpack": "^5.28.5",
29
29
  "@types/webpack-sources": "^3.2.3",
30
30
  "postcss-load-config": "^4.0.2",
31
31
  "postcss-loader": "^7.3.4",
32
- "ts-node": "^10.9.2",
33
32
  "typescript": "^5.9.3",
34
33
  "webpack-bundle-analyzer": "^4.10.2"
35
34
  },
36
35
  "dependencies": {
37
- "@plaudit/php-writer": "^1.2.3",
36
+ "@plaudit/php-writer": "^1.3.1",
38
37
  "@plaudit/postcss-color-function": "^5.0.0",
39
38
  "@plaudit/postcss-legacy-shorthand": "^1.0.0",
40
39
  "@plaudit/postcss-silent-extend": "^3.0.0",
41
40
  "@plaudit/postcss-strip-units": "^3.0.0",
42
41
  "@plaudit/postcss-variables": "^1.1.0",
43
- "@wordpress/dependency-extraction-webpack-plugin": "^6.34.0",
42
+ "@wordpress/dependency-extraction-webpack-plugin": "^6.35.0",
44
43
  "@wordpress/scripts": "^30.27.0",
45
- "autoprefixer": "^10.4.21",
44
+ "autoprefixer": "^10.4.22",
46
45
  "browser-sync": "^3.0.4",
47
- "copy-webpack-plugin": "^10.2.4",
46
+ "copy-webpack-plugin": "10.2.4",
48
47
  "cssnano": "^6.1.2",
49
48
  "eslint-plugin-jsdoc": "^48.11.0",
50
49
  "fork-ts-checker-webpack-plugin": "^9.1.0",
@@ -62,8 +61,6 @@
62
61
  "postcss-reporter": "^7.1.0",
63
62
  "postcss-simple-vars": "^7.0.1",
64
63
  "postcss-url": "^10.1.3",
65
- "react": "^18.3.1",
66
- "react-dom": "^18.3.1",
67
64
  "webpack": "^5.102.1",
68
65
  "webpack-remove-empty-scripts": "^1.1.1",
69
66
  "xml-formatter": "^3.6.7"