Skip to content

Commit 3fecec8

Browse files
committed
Smartly skip just app styles when using CDN
1 parent 2f2ec3e commit 3fecec8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/framework/src/Framework/Actions/PreBuildTasks/TransferMediaAssets.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ public function handle(): void
2020
{
2121
$this->newLine();
2222

23-
if (MediaFile::all()->isEmpty()) {
23+
$files = MediaFile::all();
24+
25+
if (Config::getBool('hyde.load_app_styles_from_cdn')) {
26+
$files->forget('app.css');
27+
}
28+
29+
if ($files->isEmpty()) {
2430
$this->skip("No media files to transfer.\n");
2531
}
2632

2733
if (Config::getBool('hyde.load_app_styles_from_cdn') && MediaFile::files() === ['app.css']) {
2834
$this->skip("No media files to transfer, using CDN.\n");
2935
}
3036

31-
$this->withProgressBar(MediaFile::all(), function (MediaFile $file): void {
37+
$this->withProgressBar($files, function (MediaFile $file): void {
3238
$sitePath = $file->getOutputPath();
3339
$this->needsParentDirectory($sitePath);
3440
Filesystem::putContents($sitePath, $file->getContents());

0 commit comments

Comments
 (0)