Skip to content

Commit

Permalink
feat: allow users to define client dev server url (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaulz authored Sep 1, 2022
1 parent 1fbe31f commit c73c8e7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,24 @@ protected function getDevServerPathUrl(string $path): string
return Str::of($this->config('dev_server.url'))->finish('/')->append($path);
}

/**
* Gets the client development server URL for the given path.
*/
protected function getClientDevServerPathUrl(string $path): string
{
if (!$this->config('dev_server.client_url')) {
return $this->getDevServerPathUrl($path);
}

return Str::of($this->config('dev_server.url'))->finish('/')->append($path);
}

/**
* Creates a script tag using the development server URL.
*/
protected function createDevelopmentTag(string $path): string
{
$url = $this->getDevServerPathUrl($path);
$url = $this->getClientDevServerPathUrl($path);

if (Str::endsWith($path, ['.css', '.scss', '.sass', '.less', '.styl', '.stylus'])) {
return $this->tagGenerator->makeStyleTag($url);
Expand Down

0 comments on commit c73c8e7

Please # to comment.