Skip to content

Commit fec2177

Browse files
committed
Silence Sass legacy JS API deprecation warning
Suppress the "The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0" warning by configuring rollup-plugin-postcss to use the new silenceDeprecations option for sass. This change updates the rollup config to pass silenceDeprecations: ['legacy-js-api'] to the sass preprocessor, preventing the deprecation warnings during build.
1 parent 31e0f9a commit fec2177

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/pluggable-widgets-tools/configs/rollup.config.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ export default async args => {
158158
minimize: production,
159159
plugins: [postcssImport(), postcssUrl({ url: "inline" })],
160160
sourceMap: !production ? "inline" : false,
161-
use: ["sass"]
161+
use: {
162+
sass: {
163+
silenceDeprecations: ['legacy-js-api']
164+
}
165+
}
162166
}),
163167
...getCommonPlugins({
164168
sourceMaps: !production,
@@ -354,7 +358,11 @@ export function postCssPlugin(outputFormat, production, postcssPlugins = []) {
354358
...postcssPlugins
355359
],
356360
sourceMap: !production ? "inline" : false,
357-
use: ["sass"],
361+
use: {
362+
sass: {
363+
silenceDeprecations: ['legacy-js-api']
364+
}
365+
},
358366
to: join(outDir, `${outWidgetFile}.css`)
359367
});
360368
}

0 commit comments

Comments
 (0)