Skip to content

Commit 73a82e7

Browse files
committed
Fix some sass deprecation warnings.
Silence the rest, as it originates from bootstrap 5, which we do not have control over. Keep an @import for bootstrap in the application.scss as bootstrap is not compatible with newer sass. Also switch sass-loader to use the modern Dart Sass JavaScript API instead of the legacy one. This resolves Module Warning (from ./node_modules/sass-loader/dist/cjs.js): Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api
1 parent c55a5c6 commit 73a82e7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

public/scss/application.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
@charset "utf-8";
22

3-
@import "vars";
4-
@import "authentication";
5-
@import "wayg";
6-
@import "~bootstrap/scss/bootstrap";
3+
@use "vars" as *;
4+
@use "authentication";
5+
@use "wayg";
6+
7+
@import "../../node_modules/bootstrap/scss/bootstrap";
78

89
body {
910
background-color: $gray-200;

public/scss/authentication.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "vars" as *;
2+
13
body.authentication {
24

35
.container.authentication {

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ Encore
99
.enableTypeScriptLoader()
1010
.enableLessLoader()
1111
.enableSassLoader(options => {
12+
options.api = 'modern';
1213
options.sassOptions = {
1314
outputStyle: 'expanded',
1415
includePaths: ['public'],
16+
silenceDeprecations: ["import", "color-functions", "global-builtin"]
1517
};
18+
options.webpackImporter = false;
1619
})
1720

1821
.addStyleEntry('global', [

0 commit comments

Comments
 (0)