sass >= 1.35.0
has the option quietDeps
and silenceDeprecations
to silence deprecation warnings from dependencies.
-
quietDeps
: No deprecation warnings for dependencies e.g. Bootstrap -
silenceDeprecations
: Allows to set a list of deprecation types Show archive.org snapshot you want to silence for your own code
Below there are a few examples for different build tools how to set the Sass options.
Webpacker
const sassLoaderConfig = environment.loaders.get('sass')
const sassLoaderIndex = sassLoaderConfig.use.findIndex(config => { return config.loader === 'sass-loader' })
// Disable deprecation warnings inside dependencies
sassLoaderConfig.use[sassLoaderIndex].options.sassOptions.quietDeps = true
sassLoaderConfig.use[sassLoaderIndex].options.sassOptions.silenceDeprecations = ['import']
Webpack
module.exports = {
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
"style-loader",
"css-loader",
{
loader: "sass-loader",
options: {
sassOptions: {
quietDeps: true,
silenceDeprecations: ['import'],
},
},
},
],
},
],
},
};
ESBuild
esbuild.build({
// ...
plugins: [
sassPlugin({
quietDeps: true,
silenceDeprecations: ['import'],
// ...
Posted by Daniel Straßner to makandra dev (2022-10-31 16:51)