From d27bb14b6880b7bbb27b91da902c87d4686cc515 Mon Sep 17 00:00:00 2001 From: Zack Tanner <1939140+ztanner@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:45:55 -0800 Subject: [PATCH] backport: fix(turbo): sassOptions silenceDeprecations was not overwritten with user options (#74005) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backports: - https://github.com/vercel/next.js/pull/73937 Co-authored-by: Jiwon Choi Co-authored-by: Donny/강동윤 --- .../next-core/src/next_shared/webpack_rules/sass.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/next-core/src/next_shared/webpack_rules/sass.rs b/crates/next-core/src/next_shared/webpack_rules/sass.rs index 296142d0f49ba..039030d1b6391 100644 --- a/crates/next-core/src/next_shared/webpack_rules/sass.rs +++ b/crates/next-core/src/next_shared/webpack_rules/sass.rs @@ -16,10 +16,13 @@ pub async fn maybe_add_sass_loader( bail!("sass_options must be an object"); }; // TODO: Remove this once we upgrade to sass-loader 16 - sass_options.insert( - "silenceDeprecations".into(), - serde_json::json!(["legacy-js-api"]), - ); + let silence_deprecations = if let Some(v) = sass_options.get("silenceDeprecations") { + v.clone() + } else { + serde_json::json!(["legacy-js-api"]) + }; + + sass_options.insert("silenceDeprecations".into(), silence_deprecations); let mut rules = if let Some(webpack_rules) = webpack_rules { webpack_rules.await?.clone_value() } else {