From 5b0a8bfbcb94d7458ba9d27e42e396bc7dda43af Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 7 Jul 2022 11:03:16 +0100 Subject: [PATCH] DEV: Make sass deprecations quieter during test build (#17369) --- .../discourse/lib/discourse-scss.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/discourse-scss.js b/app/assets/javascripts/discourse/lib/discourse-scss.js index fd851831472..41167ed7344 100644 --- a/app/assets/javascripts/discourse/lib/discourse-scss.js +++ b/app/assets/javascripts/discourse/lib/discourse-scss.js @@ -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"),