Filters an asset after it has been loaded.
AssetInterface $asset An asset:
Overrides FilterInterface::filterLoad
public function filterLoad(AssetInterface $asset) {
$root = $asset
->getSourceRoot();
$path = $asset
->getSourcePath();
$lc = new \lessc();
if ($root && $path) {
$lc->importDir = dirname($root . '/' . $path);
}
foreach ($this->loadPaths as $loadPath) {
$lc
->addImportDir($loadPath);
}
if ($this->formatter) {
$lc
->setFormatter($this->formatter);
}
if (null !== $this->preserveComments) {
$lc
->setPreserveComments($this->preserveComments);
}
$asset
->setContent($lc
->parse($asset
->getContent(), $this->presets));
}