@plaudit/webpack-extensions 2.14.1 → 2.15.1

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.
@@ -95,14 +95,15 @@ class BlockJSONManagingPlugin {
95
95
  }
96
96
  else {
97
97
  if (typeof json["plaudit"] !== 'object') {
98
- json["plaudit"] = {};
98
+ if (json["plaudit"] === "native") {
99
+ json["plaudit"] = { type: "native" };
100
+ }
101
+ else {
102
+ json["plaudit"] = {};
103
+ }
99
104
  }
100
105
  json["plaudit"]["setup"] = setupFiles.length === 1 ? setupFiles[0] : setupFiles;
101
106
  }
102
- if (json["render"] && (json["acf"] || json["plaudit"])) {
103
- json["render_template"] = json["render"];
104
- delete json["render"];
105
- }
106
107
  if (json["acf"]) {
107
108
  if (json["acf"]["renderTemplate"]) {
108
109
  json["render_template"] = json["acf"]["renderTemplate"];
@@ -126,14 +127,14 @@ class BlockJSONManagingPlugin {
126
127
  }
127
128
  else {
128
129
  let validTemplateLocation, invalidTemplateLocation;
129
- if (json["acf"] || json["plaudit"]) {
130
- validTemplateLocation = "render_template";
131
- invalidTemplateLocation = "render";
132
- }
133
- else {
130
+ if (!json["acf"] && (json["plaudit"] === "native" || (typeof json["plaudit"] === 'object' && json["plaudit"]?.["type"] === "native"))) {
134
131
  validTemplateLocation = "render";
135
132
  invalidTemplateLocation = "render_template";
136
133
  }
134
+ else {
135
+ validTemplateLocation = "render_template";
136
+ invalidTemplateLocation = "render";
137
+ }
137
138
  delete json[invalidTemplateLocation];
138
139
  json[validTemplateLocation] = renderTemplate.length === 1 ? renderTemplate[0] : renderTemplate;
139
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.14.1",
3
+ "version": "2.15.1",
4
4
  "scripts": {
5
5
  "prepublishOnly": "rm -rf build && mkdir build && tsc",
6
6
  "build": "tsc",