@ -120,7 +120,7 @@ function scssphp_inline_compile($style, $contexte, $cache_options, $import_dirs,
// https://scssphp.github.io/scssphp/docs/#source-maps
if (defined('_SCSS_SOURCE_MAP') & & constant('_SCSS_SOURCE_MAP') === true) {
$scss->setSourceMap(ScssPhp\ScssPhp\Compiler::SOURCE_MAP_INLINE);
$scss->setSourceMapOptions(array(
$scss->setSourceMapOptions([
// This value is prepended to the individual entries in the 'source' field.
'sourceRoot' => '',
// an optional name of the generated code that this source map is associated with.
@ -135,15 +135,15 @@ function scssphp_inline_compile($style, $contexte, $cache_options, $import_dirs,
'sourceMapRootpath' => '/',
// base path for filename normalization
// difference between file & url locations, removed from ALL source files in .map
'sourceMapBasepath' => '/local/cache-scss/'
) );
'sourceMapBasepath' => _ROOT_CWD
] );
}
$files = [];
try {
$result = $scss->compileString($style, $contexte['file'] ?? null);
$out = (string) $result->getSourceMap() . $result->getCss();
$out = $result->getCss();
$files = $result->getIncludedFiles();
spip_log($log_pre. ' compile '. ($contexte['file'] ?? substr($style,0,100)) . ' :: '.spip_timer('scss_compile'), 'scssphp');