Commit 4b4b872e authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] fix sourcemap creation

parent ff0dd2d6
......@@ -154,14 +154,14 @@ module.exports = class Css extends Task {
compiledSass = await render({
file: _input,
outFile: _output,
outputStyle: 'expanded',
outputStyle: 'compact',
sourceMap: this._config.cssPipeline.sourceMaps,
sourceMapEmbed: false,
sourceMapEmbed: true,
sourceMapContents: true,
precision: 8,
importer: globImporter()
});
} catch (_error) {
console.log(_error);
return this._logger.error(_error.stack);
}
......@@ -171,14 +171,15 @@ module.exports = class Css extends Task {
if (this._config.cssPipeline.cleanCss) {
postCssPlugins.push(postcssClean);
}
let postProcessedCss = await postcss(postCssPlugins).process(cssString, {
from: _input,
to: _output,
map: this._config.cssPipeline.sourceMaps ? {
prev: compiledSass.map.toString(),
inline: false,
annotation: path.join(path.relative(path.dirname(_output), path.dirname(sourceMapPath)), path.basename(sourceMapPath))
} : undefined
annotation: path.join(path.relative(path.dirname(_output), path.dirname(sourceMapPath)), path.basename(sourceMapPath)),
sourcesContent: true,
} : false
});
await this._writeFile(_output, postProcessedCss.css);
......
{
"name": "sgc",
"version": "3.1.0",
"version": "3.2.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -5436,7 +5436,7 @@
"dependencies": {
"minimist": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz",
"integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY="
}
}
......@@ -8906,7 +8906,7 @@
"dependencies": {
"through": {
"version": "2.2.7",
"resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz",
"resolved": "http://registry.npmjs.org/through/-/through-2.2.7.tgz",
"integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0="
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment