@plaudit/webpack-extensions 2.58.3 → 2.58.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/build/plugins/BlockJSONManagingPlugin.js +1 -0
- package/build/plugins/ExtensionsConfigFileGeneratorPlugin.js +3 -2
- package/build/plugins/PlainEntrypointsConfigFileGeneratorPlugin.js +1 -1
- package/build/plugins/SpecialAssetHandlingPlugin.js +1 -1
- package/build/plugins/UnifiedLoaderGenerator.d.ts +1 -0
- package/build/plugins/UnifiedLoaderGenerator.js +5 -4
- package/package.json +1 -1
|
@@ -323,6 +323,7 @@ class BlockJSONManagingPlugin {
|
|
|
323
323
|
compilation.hooks.processAssets.tap({ name: `${this.constructor.name}_UnifiedLoaderGeneratorIntegration`, stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_DERIVED }, () => {
|
|
324
324
|
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.resolve(this.id, {
|
|
325
325
|
group: `block-json-${this.blocksDest}`,
|
|
326
|
+
requiresBaseURI: false,
|
|
326
327
|
action: writer => {
|
|
327
328
|
writer
|
|
328
329
|
.use("Plaudit\\Common\\ACF\\BlockManager")
|
|
@@ -96,7 +96,8 @@ class ExtensionsConfigFileGeneratorPlugin {
|
|
|
96
96
|
compilation.deleteAsset("assets.json");
|
|
97
97
|
ExtensionsConfigFileGeneratorPlugin.semaphore.resolve(this.id, myCacheData);
|
|
98
98
|
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.resolve(this.id, myCacheData.setupFiles.length > 0 || myCacheData.assets.length > 0 ? {
|
|
99
|
-
group:
|
|
99
|
+
group: `extensions-config-v2-${this.extensionsDest}`,
|
|
100
|
+
requiresBaseURI: true,
|
|
100
101
|
action: writer => {
|
|
101
102
|
let finalExtensionsDest = this.extensionsDest.endsWith("/") ? this.extensionsDest : this.extensionsDest + "/";
|
|
102
103
|
if (!finalExtensionsDest.startsWith("/")) {
|
|
@@ -131,7 +132,7 @@ class ExtensionsConfigFileGeneratorPlugin {
|
|
|
131
132
|
compiler.hooks.thisCompilation.tap(this.constructor.name, compilation => {
|
|
132
133
|
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.reset(this.id);
|
|
133
134
|
compilation.hooks.processAssets.tap({ name: `${this.constructor.name}_UnifiedLoaderGeneratorIntegration`, stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_DERIVED }, () => {
|
|
134
|
-
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.resolve(this.id, { group:
|
|
135
|
+
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.resolve(this.id, { group: `extensions-config-v1-${this.extensionsDest}`, requiresBaseURI: false, action: writer => {
|
|
135
136
|
writer
|
|
136
137
|
.use("Plaudit\\Base\\API\\ThemeUtils")
|
|
137
138
|
.call("ThemeUtils::installExtensionSupport", [new php_writer_1.Expr(`__DIR__.${php_writer_1.Expr.convertJsonToPHP(this.extensionsDest)}`)]);
|
|
@@ -104,7 +104,7 @@ class PlainEntrypointsConfigFileGeneratorPlugin {
|
|
|
104
104
|
compilation.deleteAsset("assets.json");
|
|
105
105
|
PlainEntrypointsConfigFileGeneratorPlugin.semaphore.resolve(this.id, myAssetHandles);
|
|
106
106
|
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.resolve(this.id, myAssetHandles.length
|
|
107
|
-
? { group: 'plain-entrypoints-v2', action: writer => writer.append("require_once __DIR__.'/plain-entrypoints-loader.php';") }
|
|
107
|
+
? { group: 'plain-entrypoints-v2', requiresBaseURI: true, action: writer => writer.append("require_once __DIR__.'/plain-entrypoints-loader.php';") }
|
|
108
108
|
: undefined);
|
|
109
109
|
}
|
|
110
110
|
catch (e) {
|
|
@@ -65,7 +65,7 @@ class SpecialAssetHandlingPlugin {
|
|
|
65
65
|
}
|
|
66
66
|
SpecialAssetHandlingPlugin.semaphore.resolve(this.id, specialAssetData);
|
|
67
67
|
UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore.resolve(this.id, Object.keys(specialAssetData).length > 0
|
|
68
|
-
? { group: 'special-assets', action: writer => writer.append("require_once __DIR__.'/special-assets.php';") }
|
|
68
|
+
? { group: 'special-assets', requiresBaseURI: true, action: writer => writer.append("require_once __DIR__.'/special-assets.php';") }
|
|
69
69
|
: undefined);
|
|
70
70
|
}
|
|
71
71
|
catch (e) {
|
|
@@ -30,14 +30,15 @@ class UnifiedLoaderGenerator {
|
|
|
30
30
|
const ap = a.priority ?? 0, bp = b.priority ?? 0;
|
|
31
31
|
return ap === bp ? a.group.localeCompare(b.group) : bp - ap;
|
|
32
32
|
})
|
|
33
|
-
.filter(a => !alreadyAllocatedGroups.has(a.group) && alreadyAllocatedGroups.add(a.group))
|
|
34
|
-
.map(a => a.action);
|
|
33
|
+
.filter(a => !alreadyAllocatedGroups.has(a.group) && alreadyAllocatedGroups.add(a.group));
|
|
35
34
|
if (writerCallbacks.length > 0) {
|
|
36
35
|
compilation.hooks.afterProcessAssets.tap(this.constructor.name, () => {
|
|
37
36
|
const writer = new php_writer_1.PHPWriter();
|
|
38
|
-
|
|
37
|
+
if (writerCallbacks.some(wc => wc.requiresBaseURI)) {
|
|
38
|
+
PlainEntrypointsConfigFileGeneratorPlugin_1.PlainEntrypointsConfigFileGeneratorPlugin.emitResolveBaseUriFunction(writer);
|
|
39
|
+
}
|
|
39
40
|
for (const writerCallback of writerCallbacks) {
|
|
40
|
-
writerCallback(writer);
|
|
41
|
+
writerCallback.action(writer);
|
|
41
42
|
}
|
|
42
43
|
writer.emitAsset(compilation, "unified-loader.php");
|
|
43
44
|
});
|