Skip to content

Commit

Permalink
fix: do not exclude static copy if debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Jan 29, 2025
1 parent f01f8f0 commit 3bca62a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Step/StaticFiles/Copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ public function init(array $options): void
*/
public function process(): void
{
$target = $this->config->get('static.target');
$exclude = $this->config->get('static.exclude');

// abord exclude if in debug mode + sourcemap
if ($this->builder->isDebug() && (bool) $this->config->get('assets.compile.sourcemap')) {
$exclude = [];
}

// copying content of '<theme>/static/' dir if exists
if ($this->config->hasTheme()) {
$themes = array_reverse($this->config->getTheme());
foreach ($themes as $theme) {
$this->copy(
$this->config->getThemeDirPath($theme, 'static'),
$this->config->get('static.target'),
$this->config->get('static.exclude')
);
$this->copy($this->config->getThemeDirPath($theme, 'static'), $target, $exclude);
}
}

// copying content of 'static/' dir if exists
$this->copy(
$this->config->getStaticPath(),
$this->config->get('static.target'),
$this->config->get('static.exclude')
);
$this->copy($this->config->getStaticPath(), $target, $exclude);

// copying assets in debug mode (for source maps)
if ($this->builder->isDebug() && (bool) $this->config->get('assets.compile.sourcemap')) {
Expand Down

0 comments on commit 3bca62a

Please sign in to comment.