diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-02-24 03:00:35 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-02-25 04:18:03 +0400 |
commit | 2fc593e88a74c254aeec35254e7e7a0ee705166d (patch) | |
tree | 650c387acd9767e64c9f0eb4542da8cd2f32e434 /core/AssetManager | |
parent | fa2f6be56d82730b49489f88290779bdcfaa4457 (diff) |
refs #2174 add an import directory only if the asset contains an @import. Fixes a file named admin.less file in any plugin overwrites the admin.less file in Morpheus plugin
Diffstat (limited to 'core/AssetManager')
-rw-r--r-- | core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php b/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php index 633443ef6f..b135cc0e82 100644 --- a/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php +++ b/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php @@ -31,7 +31,12 @@ class StylesheetUIAssetMerger extends UIAssetMerger protected function getMergedAssets() { foreach($this->getAssetCatalog()->getAssets() as $uiAsset) { - $this->lessCompiler->addImportDir(dirname($uiAsset->getAbsoluteLocation())); + + $content = $uiAsset->getContent(); + if (false !== strpos($content, '@import')) { + $this->lessCompiler->addImportDir(dirname($uiAsset->getAbsoluteLocation())); + } + } return $this->lessCompiler->compile($this->getConcatenatedAssets()); |