Skip to content

Commit

Permalink
fix(turbo): sassOptions silenceDeprecations was not overwritten wit…
Browse files Browse the repository at this point in the history
…h user options (#73937)

### Why?

The user's `silenceDeprecations` option was not overwritten in
turbopack, only the `legacy-js-api` was passed.

Thanks to @mzronek for reporting at
#71638 (comment)!

Co-authored-by: Donny/강동윤 <[email protected]>
  • Loading branch information
devjiwonchoi and kdy1 authored Dec 14, 2024
1 parent a0260b3 commit 7b8bf6e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/next-core/src/next_shared/webpack_rules/sass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7b8bf6e

Please sign in to comment.