Sass: How to get rid of deprecation warnings in dependencies

Updated . Posted . Visible to the public.

sass >= 1.35.0 has the option quietDeps and silenceDeprecations to silence deprecation warnings from dependencies.

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'],
      // ...
Daniel Straßner
Last edit
Emanuel
License
Source code in this card is licensed under the MIT License.
Posted by Daniel Straßner to makandra dev (2022-10-31 16:51)