Skip to content

Commit

Permalink
Fix cache import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
RdeWilde committed Mar 17, 2020
1 parent df2c25e commit e10e470
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions SassHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,24 @@ public function publish(
* @throws CException
* @return string
*/
public function getCompiledFile($sourcePath)
{
public function getCompiledFile($sourcePath) {
$cssPath = $this->getCompiledCssFilePath($sourcePath);

if ($this->autoAddCurrentDirectoryAsImportPath) {
// Theme sass
if ($theme = EO::app()->getTheme()) {
if (!empty($theme->basePath)) {
$this->compiler->addImportPath($theme->basePath);
}
}

// Project sass
$this->compiler->addImportPath(dirname($sourcePath));

// Vendor sasss
$this->compiler->addImportPath(YiiBase::getPathOfAlias('vendor.digizijn'));
}

if ($this->isCompilationNeeded($sourcePath)) {
$compiledCssCode = $this->compile($sourcePath);

Expand Down Expand Up @@ -344,21 +359,6 @@ public function getCompiledFile($sourcePath)
* @return string Compiled CSS code
*/
public function compile($sourcePath) {
if ($this->autoAddCurrentDirectoryAsImportPath) {
// Theme sass
if ($theme = EO::app()->getTheme()) {
if (!empty($theme->basePath)) {
$this->compiler->addImportPath($theme->basePath);
}
}

// Project sass
$this->compiler->addImportPath(dirname($sourcePath));

// Vendor sasss
$this->compiler->addImportPath(YiiBase::getPathOfAlias('vendor.digizijn'));
}

$sourceCode = file_get_contents($sourcePath);
if ($sourceCode === false) {
throw new CException(
Expand Down

0 comments on commit e10e470

Please sign in to comment.