src/ScssAssetConverter.php
public function convert($asset, $basePath)
    {
        $extension = $this->getExtension($asset);
        if ($extension !== 'scss') {
            return $asset;
        }
        $cssAsset = $this->getCssAsset($asset, 'css');

        $inFile = "$basePath/$asset";
        $outFile = "$basePath/$cssAsset";
        
        $this->compiler->setImportPaths(dirname($inFile));

        if (!$this->storage->exists($inFile)) {
            Yii::error("Input file $inFile not found.", __METHOD__);
            return $asset;
        }

        $this->convertAndSaveIfNeeded($inFile, $outFile);

        return $cssAsset;
    }
public function convert($asset, $basePath)
    {
        $extension = $this->getExtension($asset);
        if ($extension !== 'scss') {
            return $asset;
        }
        $cssAsset = $this->getCssAsset($asset, 'css');

        $inFile = "$basePath/$asset";
        $outFile = "$basePath/$cssAsset";
        
        $this->compiler->setImportPaths(dirname($inFile));

        if (!$this->storage->exists($inFile)) {
            Yii::error("Input file $inFile not found.", __METHOD__);
            return $asset;
        }

        $this->convertAndSaveIfNeeded($inFile, $outFile);

        return $cssAsset;
    }
public function convert ( $ asset , $ basePath ) { $ extension = $ this -> getExtension ( $ asset ) ; if ( $ extension !== 'scss' ) { return $ asset ; } $ cssAsset = $ this -> getCssAsset ( $ asset , 'css' ) ; $ inFile = "$basePath/$asset" ; $ outFile = "$basePath/$cssAsset" ; $ this -> compiler -> setImportPaths ( dirname ( $ inFile ) ) ; if ( ! $ this -> storage -> exists ( $ inFile ) ) { Yii :: error ( "Input file $inFile not found." , __METHOD__ ) ; return $ asset ; } $ this -> convertAndSaveIfNeeded ( $ inFile , $ outFile ) ; return $ cssAsset ; }
Converts a given SCSS asset file into a CSS file.
@param string $asset the asset file path, relative to $basePath
@param string $basePath the directory the $asset is relative to.
@return string the converted asset file path, relative to $basePath.
Converts a given SCSS asset file into a CSS file .