Skip to content

Commit 71c5392

Browse files
committed
ensure Livewire dispatcher is bundled
1 parent 4c5793c commit 71c5392

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Builder/Concerns/CopiesToBuildDirectory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function copyToBuildDirectory(): bool
8888
}
8989

9090
$this->keepRequiredDirectories();
91+
$this->keepLivewireDispatcher();
9192

9293
return true;
9394
}
@@ -106,4 +107,17 @@ private function keepRequiredDirectories()
106107
$filesystem->dumpFile("{$buildPath}/storage/app/public/_native.json", '{}');
107108
$filesystem->dumpFile("{$buildPath}/storage/logs/_native.json", '{}');
108109
}
110+
111+
private function keepLivewireDispatcher()
112+
{
113+
// This is a bit leaky, since we only need this for electron, not potential other drivers
114+
// We'll find a better place for it when we add more drivers.
115+
$dispatcherPath = 'vendor/nativephp/desktop/resources/electron/electron-plugin/src/preload/livewire-dispatcher.js';
116+
$filesystem = new Filesystem;
117+
118+
$filesystem->copy(
119+
$this->sourcePath($dispatcherPath),
120+
$this->buildPath("app/{$dispatcherPath}")
121+
);
122+
}
109123
}

0 commit comments

Comments
 (0)