diff --git a/packages/plugin-sass/src/index.ts b/packages/plugin-sass/src/index.ts index 2ad7bf448f..0d189da0b0 100644 --- a/packages/plugin-sass/src/index.ts +++ b/packages/plugin-sass/src/index.ts @@ -53,6 +53,10 @@ const getSassLoaderOptions = ( sourceMap: isUseCssSourceMap, api: 'modern-compiler', implementation: require.resolve('sass-embedded'), + sassOptions: { + // mute deprecation warnings of dependencies + quietDeps: true, + }, }, config: userOptions, ctx: { addExcludes }, diff --git a/packages/plugin-sass/tests/__snapshots__/index.test.ts.snap b/packages/plugin-sass/tests/__snapshots__/index.test.ts.snap index 08e90404ef..db5e5aaf04 100644 --- a/packages/plugin-sass/tests/__snapshots__/index.test.ts.snap +++ b/packages/plugin-sass/tests/__snapshots__/index.test.ts.snap @@ -49,6 +49,9 @@ exports[`plugin-sass > should add sass-loader 1`] = ` "options": { "api": "modern-compiler", "implementation": "/node_modules//sass-embedded/dist/lib/index.js", + "sassOptions": { + "quietDeps": true, + }, "sourceMap": true, }, }, @@ -106,6 +109,9 @@ exports[`plugin-sass > should add sass-loader and css-loader when injectStyles 1 "options": { "api": "modern-compiler", "implementation": "/node_modules//sass-embedded/dist/lib/index.js", + "sassOptions": { + "quietDeps": true, + }, "sourceMap": true, }, }, @@ -166,6 +172,9 @@ exports[`plugin-sass > should add sass-loader with excludes 1`] = ` "options": { "api": "modern-compiler", "implementation": "/node_modules//sass-embedded/dist/lib/index.js", + "sassOptions": { + "quietDeps": true, + }, "sourceMap": true, }, }, @@ -224,6 +233,7 @@ exports[`plugin-sass > should allow to use legacy API and mute deprecation warni "api": "legacy", "implementation": "/node_modules//sass-embedded/dist/lib/index.js", "sassOptions": { + "quietDeps": true, "silenceDeprecations": [ "legacy-js-api", ], diff --git a/website/docs/en/plugins/list/plugin-sass.mdx b/website/docs/en/plugins/list/plugin-sass.mdx index 957a21a7d7..e0038b94db 100644 --- a/website/docs/en/plugins/list/plugin-sass.mdx +++ b/website/docs/en/plugins/list/plugin-sass.mdx @@ -53,6 +53,10 @@ const defaultOptions = { api: 'modern-compiler', implementation: require.resolve('sass-embedded'), sourceMap: rsbuildConfig.output.sourceMap.css, + sassOptions: { + quietDeps: true, + silenceDeprecations: api === 'legacy' ? ['legacy-js-api'] : undefined, + }, }; ``` diff --git a/website/docs/zh/plugins/list/plugin-sass.mdx b/website/docs/zh/plugins/list/plugin-sass.mdx index df4e0673b0..195e0cefb0 100644 --- a/website/docs/zh/plugins/list/plugin-sass.mdx +++ b/website/docs/zh/plugins/list/plugin-sass.mdx @@ -53,6 +53,10 @@ const defaultOptions = { api: 'modern-compiler', implementation: require.resolve('sass-embedded'), sourceMap: rsbuildConfig.output.sourceMap.css, + sassOptions: { + quietDeps: true, + silenceDeprecations: api === 'legacy' ? ['legacy-js-api'] : undefined, + }, }; ```