From a75f1dbc4f88373928dd0987cdb33351c318d23a Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 26 Nov 2015 12:41:36 +0800 Subject: [PATCH] MDL-50258 themes: Fix CSS source maps --- lib/outputlib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index e1ada8ac800..64e02997da4 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1078,6 +1078,7 @@ class theme_config { * @return bool|string Return false when the compilation failed. Else the compiled string. */ protected function get_css_content_from_less($themedesigner) { + global $CFG; $lessfile = $this->lessfile; if (!$lessfile || !is_readable($this->dir . '/less/' . $lessfile . '.less')) { @@ -1106,7 +1107,8 @@ class theme_config { if ($themedesigner) { // Add the sourceMap inline to ensure that it is atomically generated. $options['sourceMap'] = true; - $options['sourceRoot'] = 'theme'; + $options['sourceMapBasepath'] = $CFG->dirroot; + $options['sourceMapRootpath'] = $CFG->wwwroot; } // Instantiate the compiler.