@plaudit/webpack-extensions 2.73.1 → 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]);
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.1",
3
+ "version": "2.73.2",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/build"
@@ -22,7 +22,7 @@
22
22
  "devDependencies": {
23
23
  "@plaudit/gutenberg-api-extensions": "^2.79.0",
24
24
  "@types/browser-sync-webpack-plugin": "^2.2.5",
25
- "@types/node": "^24.10.0",
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",
@@ -39,7 +39,7 @@
39
39
  "@plaudit/postcss-silent-extend": "^3.0.0",
40
40
  "@plaudit/postcss-strip-units": "^3.0.0",
41
41
  "@plaudit/postcss-variables": "^1.1.0",
42
- "@wordpress/dependency-extraction-webpack-plugin": "^6.34.0",
42
+ "@wordpress/dependency-extraction-webpack-plugin": "^6.35.0",
43
43
  "@wordpress/scripts": "^30.27.0",
44
44
  "autoprefixer": "^10.4.22",
45
45
  "browser-sync": "^3.0.4",