Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

silence sass legacy-js-api warning #72632

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crates/next-core/src/next_shared/webpack_rules/sass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ pub async fn maybe_add_sass_loader(
webpack_rules: Option<Vc<WebpackRules>>,
) -> Result<Vc<OptionWebpackRules>> {
let sass_options = sass_options.await?;
let Some(sass_options) = sass_options.as_object() else {
let Some(mut sass_options) = sass_options.as_object().cloned() else {
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 mut rules = if let Some(webpack_rules) = webpack_rules {
webpack_rules.await?.clone_value()
} else {
Expand Down
2 changes: 2 additions & 0 deletions packages/next/src/build/webpack/config/blocks/css/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ export const css = curry(async function css(
// Since it's optional and not required, we'll disable it by default
// to avoid the confusion.
fibers: false,
// TODO: Remove this once we upgrade to sass-loader 16
silenceDeprecations: ['legacy-js-api'],
...sassOptions,
},
additionalData: sassPrependData || sassAdditionalData,
Expand Down
Loading