in packages/just-scripts/src/tasks/sassTask.ts [49:85]
function (cb: any) {
fileName = path.resolve(fileName);
nodeSass.render(
{
file: fileName,
importer: patchSassUrl,
includePaths: [path.resolve(process.cwd(), 'node_modules')],
},
(err: Error, result: { css: Buffer }) => {
if (err) {
cb(path.relative(process.cwd(), fileName) + ': ' + err);
} else {
const css = result.css.toString();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const plugins = [autoprefixerFn, ...postcssPlugins!];
// If the rtl plugin exists, insert it after autoprefix.
if (postcssRtl) {
plugins.splice(plugins.indexOf(autoprefixerFn) + 1, 0, postcssRtl({}));
}
// If postcss-clean exists, add it to the end of the chain.
if (clean) {
plugins.push(clean());
}
postcss(plugins)
.process(css, { from: fileName })
.then((result: { css: string }) => {
fs.writeFileSync(fileName + '.ts', createSourceModule(fileName, result.css));
cb();
});
}
},
);
},