@plaudit/webpack-extensions 2.73.1 → 2.74.0

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.
@@ -35,7 +35,7 @@ class AdditionalDependencyInjectorPlugin extends AbstractBiPhasicGroupPlugin_1.A
35
35
  const chunk = entrypoint.getEntrypointChunk();
36
36
  for (const additionalDep of additionalDependencies) {
37
37
  this.addExternalizedDep(additionalDep);
38
- compilation.chunkGraph.connectChunkAndModule(chunk, new webpack_1.ExternalModule("__REMOVE_ME__", "", additionalDep));
38
+ compilation.chunkGraph.connectChunkAndModule(chunk, new webpack_1.ExternalModule("__REMOVE_ME__", "var", additionalDep));
39
39
  }
40
40
  }));
41
41
  });
@@ -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.d.ts CHANGED
@@ -6,13 +6,15 @@ export type ParsedAssetsJson = Record<string, {
6
6
  version: string;
7
7
  }>;
8
8
  export declare function isParsedAssetsJson(thing: any): thing is ParsedAssetsJson;
9
+ type ScriptArgsObject = {
10
+ strategy?: 'defer' | 'async';
11
+ in_footer?: boolean;
12
+ fetchpriority?: 'auto' | 'low' | 'high';
13
+ };
9
14
  type BaseRestType = [/* dependencies: */ string[], /* version: */ string];
10
15
  export type HandleData = {
11
16
  src: string;
12
- rest: BaseRestType | [...BaseRestType, {
13
- strategy?: 'defer' | 'async';
14
- in_footer?: boolean;
15
- } | boolean];
17
+ rest: BaseRestType | [...BaseRestType, ScriptArgsObject | boolean];
16
18
  };
17
19
  export declare const standardLocationNamesMeta: {
18
20
  readonly clientView: {
@@ -43,10 +45,7 @@ export type UsageLocations = {
43
45
  } & {
44
46
  register?: boolean | number;
45
47
  handle?: string | ((generatedHandle: string) => string);
46
- registerScriptArgs?: {
47
- strategy?: 'defer' | 'async';
48
- in_footer?: boolean;
49
- } | boolean;
48
+ registerScriptArgs?: ScriptArgsObject | boolean;
50
49
  };
51
50
  export declare function constantKeys<K extends string, V>(object: {
52
51
  [k in K]: V;
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.74.0",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/build"
@@ -20,9 +20,9 @@
20
20
  }
21
21
  },
22
22
  "devDependencies": {
23
- "@plaudit/gutenberg-api-extensions": "^2.79.0",
23
+ "@plaudit/gutenberg-api-extensions": "^2.80.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.36.0",
43
43
  "@wordpress/scripts": "^30.27.0",
44
44
  "autoprefixer": "^10.4.22",
45
45
  "browser-sync": "^3.0.4",
@@ -61,7 +61,7 @@
61
61
  "postcss-reporter": "^7.1.0",
62
62
  "postcss-simple-vars": "^7.0.1",
63
63
  "postcss-url": "^10.1.3",
64
- "webpack": "^5.102.1",
64
+ "webpack": "^5.103.0",
65
65
  "webpack-remove-empty-scripts": "^1.1.1",
66
66
  "xml-formatter": "^3.6.7"
67
67
  },