Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const data = fs.readFileSync(source, "utf-8");
require("stylus")(data)
.set("compress", true)
.render(function(err, css) {
if (err) {
reject(err);
return;
}
resolve(css);
});
});
}
preprocessCss: function(css, filename) {
if (filename.endsWith(".styl")) {
return require("stylus")(css)
.set("filename", filename)
.render();
} else if (filename.endsWith(".scss")) {
return require("node-sass").renderSync({
css,
file: filename
}).css;
} else {
return css;
}
},
processorOpts: { parser: require("postcss-less").parse }