Skip to content

Commit

Permalink
Support CSS standalon in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
imagoiq authored Dec 30, 2024
1 parent aa288c0 commit cde0cb7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/ViteManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,24 @@ public function getScripts(string ...$entries): array

/**
* Fetches and returns all style files for the specified entry points,
* unless dev server is enabled, in which case no style are required.
* unless dev server is enabled, in which case only standalone entries are returned.
*
* @param string ...$entries
*
* @throws JsonException If manifest can't be read
* @return string[] Path to each style files
* @throws EntrypointNotFoundException If an entry point is not found in the manifest.
*
* @return string[] Path to each style files
* @throws JsonException If manifest can't be read
*/
public function getStyles(string ...$entries): array
{
// Server. Returns nothing.
$files = [];

// Server. Return standalone entries + server;
if ($this->useServer()) {
return [];
$stylesheets = array_merge(['@vite/client'], $entries);

return $this->prefixFiles($stylesheets);
}

// Default behavior
Expand Down

0 comments on commit cde0cb7

Please sign in to comment.