diff --git a/src/CSS.php b/src/CSS.php index afed766..25e6200 100644 --- a/src/CSS.php +++ b/src/CSS.php @@ -314,6 +314,10 @@ public function execute($path = null) // restore the string we've extracted earlier $css = $this->restoreExtractedData($css); + $source = $source ?: ''; + $css = $this->combineImports($source, $css); + $css = $this->importFiles($source, $css); + /* * If we'll save to a new path, we'll have to fix the relative paths * to be relative no longer to the source file, but to the new path. @@ -321,15 +325,9 @@ public function execute($path = null) * conversion happens (because we still want it to go through most * of the move code...) */ - $source = $source ?: ''; $converter = new Converter($source, $path ?: $source); $css = $this->move($converter, $css); - // if no target path is given, relative paths were not converted, so - // they'll still be relative to the source file then - $css = $this->importFiles($path ?: $source, $css); - $css = $this->combineImports($path ?: $source, $css); - // combine css $content .= $css; } diff --git a/tests/css/sample/convert_relative_path/target/.gitignore b/tests/css/sample/convert_relative_path/target/.gitignore deleted file mode 100644 index da08aec..0000000 --- a/tests/css/sample/convert_relative_path/target/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* - -!.gitignore -!relative.css diff --git a/tests/css/sample/convert_relative_path/target/relative.css b/tests/css/sample/convert_relative_path/target/relative.css deleted file mode 100644 index fed095e..0000000 --- a/tests/css/sample/convert_relative_path/target/relative.css +++ /dev/null @@ -1 +0,0 @@ -/* This file needs to exist for relative target tests to work... */ diff --git a/tests/css/sample/convert_relative_path/target/target/.gitignore b/tests/css/sample/convert_relative_path/target/target/.gitignore deleted file mode 100644 index f59ec20..0000000 --- a/tests/css/sample/convert_relative_path/target/target/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/tests/css/sample/symlink/target/.gitignore b/tests/css/sample/symlink/target/.gitignore deleted file mode 100644 index cec9082..0000000 --- a/tests/css/sample/symlink/target/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* - -!.gitignore