Skip to content

Commit

Permalink
Merge branch 'master' into 2.x-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 23, 2024
2 parents 1272423 + 1f23e69 commit 08ca495
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 41 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"require-dev": {
"desilva/psalm-coverage": "dev-master",
"driftingly/rector-laravel": "^0.14.1",
"driftingly/rector-laravel": "^1.2.0",
"hyde/monorepo-dev-tools": "*",
"hyde/realtime-compiler": "*",
"hyde/testing": "*",
Expand Down
58 changes: 22 additions & 36 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions packages/realtime-compiler/src/Actions/AssetFileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@

namespace Hyde\RealtimeCompiler\Actions;

use Illuminate\Support\Str;

/**
* Locate a static file to proxy.
*/
class AssetFileLocator
{
public static function find(string $path): ?string
{
$path = trim($path, '/');

$strategies = [
BASE_PATH.'/_site'.$path,
BASE_PATH.'/_media'.$path,
BASE_PATH.'/_site'.basename($path),
BASE_PATH.'/_media/'.basename($path),
BASE_PATH.'/_site/'.$path,
BASE_PATH.'/_media/'.$path,
BASE_PATH.'/_site/'.Str::after($path, 'media/'),
BASE_PATH.'/_media/'.Str::after($path, 'media/'),
];

foreach ($strategies as $strategy) {
Expand Down

0 comments on commit 08ca495

Please sign in to comment.