Skip to content

Commit 579050c

Browse files
authored
Silence Sass legacy JS API deprecation warning (#178)
## Summary - 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 silence the `legacy-js-api` deprecation ## Changes Updated `rollup.config.mjs` to pass `silenceDeprecations: ['legacy-js-api']` to the sass preprocessor in two places: 1. In the preview entry postcss plugin configuration (line 161) 2. In the `postCssPlugin` function (line 361) This change ports the fix from mendix/web-widgets#2234 to the widgets-tools repository. ## Test plan - [ ] Build passes without sass deprecation warnings - [ ] Widget builds work correctly with the updated configuration
2 parents 31e0f9a + 57603ab commit 579050c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

packages/pluggable-widgets-tools/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1414
### Changed
1515

1616
- We changed the order of imports in generated widget prop types to match that of the eslint sort-imports rule.
17+
- We silenced the Sass legacy JS API deprecation warning that appeared during widget bundling.
1718

1819
## [11.8.1] - 2026-03-16
1920

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)