Commit 65e458e6 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] better error handling

parent cb87aee4
......@@ -172,15 +172,21 @@ module.exports = class Css extends Task {
postCssPlugins.push(postcssClean);
}
let postProcessedCss = await postcss(postCssPlugins).process(cssString, {
from: _input,
to: _output,
map: this._config.cssPipeline.sourceMaps ? {
inline: false,
annotation: path.join(path.relative(path.dirname(_output), path.dirname(sourceMapPath)), path.basename(sourceMapPath)),
sourcesContent: true,
} : false
});
let postProcessedCss;
try {
postProcessedCss = await postcss(postCssPlugins).process(cssString, {
from: _input,
to: _output,
map: this._config.cssPipeline.sourceMaps ? {
inline: false,
annotation: path.join(path.relative(path.dirname(_output), path.dirname(sourceMapPath)), path.basename(sourceMapPath)),
sourcesContent: true,
} : false
});
} catch (_error) {
this._handleError(`${_error.message}`);
}
await this._writeFile(_output, postProcessedCss.css);
if (this._config.cssPipeline.sourceMaps) {
......
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