1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-06 22:26:28 +02:00

add base directory of input file to import path

this is needed for @import to be able to resolve included files
This commit is contained in:
Elan Ruusamäe
2016-10-13 12:20:50 +03:00
parent ae1fdf4a30
commit 3014900cd4

View File

@@ -145,7 +145,13 @@ class Minify_ScssCssSource extends Minify_Source {
{
$start = microtime(true);
$scss = new Compiler();
$css = $scss->compile(file_get_contents($filename), $filename);
// set import path directory the input filename resides
// otherwise @import statements will not find the files
// and will treat the @import line as css import
$scss->setImportPaths(dirname($filename));
$css = $scss->compile(file_get_contents($filename), $filename);
$elapsed = round((microtime(true) - $start), 4);
$v = Version::VERSION;