Skip to content

Commit 9625d12

Browse files
committed
Retransfer assets after Vite build
1 parent 7e998a2 commit 9625d12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/framework/src/Console/Commands/BuildSiteCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Hyde\Hyde;
88
use Hyde\Facades\Config;
9+
use Illuminate\Support\Arr;
910
use Hyde\Support\BuildWarnings;
1011
use Hyde\Console\Concerns\Command;
1112
use Hyde\Framework\Services\BuildService;
@@ -101,6 +102,13 @@ public function runPostBuildActions(): void
101102

102103
if ($this->option('run-vite')) {
103104
$this->runNodeCommand('npm run build', 'Building frontend assets for production!');
105+
106+
/** @var \Hyde\Framework\Actions\PreBuildTasks\TransferMediaAssets $task */
107+
$task = Arr::first($this->taskService->getRegisteredTasks(), function (string $task): bool {
108+
return class_basename($task) === 'TransferMediaAssets';
109+
});
110+
111+
(new $task)->run($this->output); // Transfer media assets to the public directory
104112
}
105113
}
106114

0 commit comments

Comments
 (0)