DEV: Make sass deprecations quieter during test build (#17369)

This commit is contained in:
David Taylor 2022-07-07 11:03:16 +01:00 committed by GitHub
parent 39c28cec87
commit 5b0a8bfbcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,10 +24,28 @@ class DiscourseScss extends Plugin {
let file = this.inputPaths[0] + "/" + this.inputFile;
let deprecationCount = 0;
let result = sass.renderSync({
file,
includePaths: this.inputPaths,
verbose: true, // call warn() for all deprecations
logger: {
warn(message, options) {
if (options.deprecation) {
deprecationCount += 1;
} else {
// eslint-disable-next-line no-console
console.warn(`\nWARNING: ${message}`);
}
},
},
});
if (deprecationCount > 0) {
// eslint-disable-next-line no-console
console.warn(
`\nWARNING: ${deprecationCount} deprecations encountered while compiling scss. (we cannot correct these until the Ruby SCSS pipeline is updated)`
);
}
fs.writeFileSync(
`${this.outputPath}/` + this.inputFile.replace(".scss", ".css"),