Skip to content

Commit 2f1d517

Browse files
authored
Silence some sass warnings in local development (#13454)
1 parent 844d1d8 commit 2f1d517

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

webpack-common.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ export function getStyleRules({
2929
plugins: postCssPlugins,
3030
},
3131
};
32+
const sassLoaderOptions = {
33+
sassOptions: {
34+
quietDeps: true,
35+
silenceDeprecations: [
36+
'import', // https://sass-lang.com/documentation/breaking-changes/import/
37+
'global-builtin', // https://sass-lang.com/documentation/breaking-changes/import/
38+
'mixed-decls', // https://sass-lang.com/documentation/breaking-changes/mixed-decls/
39+
'color-functions', // https://sass-lang.com/documentation/breaking-changes/color-functions/
40+
'slash-div', // https://sass-lang.com/documentation/breaking-changes/slash-div/
41+
],
42+
},
43+
};
3244

3345
if (bundleStylesWithJs) {
3446
// In development, we bundle styles with the JS.
@@ -39,7 +51,7 @@ export function getStyleRules({
3951
{ loader: 'style-loader' },
4052
{ loader: 'css-loader', options: cssLoaderOptions },
4153
{ loader: 'postcss-loader', options: postcssLoaderOptions },
42-
{ loader: 'sass-loader' },
54+
{ loader: 'sass-loader', options: sassLoaderOptions },
4355
],
4456
},
4557
];
@@ -53,7 +65,7 @@ export function getStyleRules({
5365
MiniCssExtractPlugin.loader,
5466
{ loader: 'css-loader', options: cssLoaderOptions },
5567
{ loader: 'postcss-loader', options: postcssLoaderOptions },
56-
{ loader: 'sass-loader' },
68+
{ loader: 'sass-loader', options: sassLoaderOptions },
5769
],
5870
},
5971
];

0 commit comments

Comments
 (0)