plumelo / rollup-plugin-styler

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
6 stars 0 forks source link

Add support for Dart Sass `quietDeps` #9

Open kr8n3r opened 1 month ago

kr8n3r commented 1 month ago

Later version of dart-sass 1.x emit warnings for upcoming v2 release. They provide a way to silence those warnings via quietDeps; true option. Consider enabling support for this.

megheaiulian commented 1 month ago

Do you perhaps have an easy to reproduce configuration snippet that I can use to replicate ?

kr8n3r commented 4 weeks ago

Hi @megheaiulian, see https://github.com/kr8n3r/simple-rollup-dart-sass-setup for a simple setup and relevant docs for dart-sass: https://sass-lang.com/documentation/js-api/interfaces/options/#quietDeps As of dart-sass 1.79 legacy JS-api has been deprecated https://sass-lang.com/documentation/breaking-changes/legacy-js-api/

Looking at the code https://github.com/plumelo/rollup-plugin-styler/blob/518261a1769d66e831c88ebb4e165b17a25acfff/src/loaders/sass/index.ts#L33 needs to change to .compile(filename)

kr8n3r commented 3 weeks ago

to add, if you change import to a ~packageName and add

sass: {
   quietDeps: true
}

to the config, dart sass warnings get silenced, but you then get the actual legacy JS api warning

`import sass from 'sass'` is deprecated.
Please use `import * as sass from 'sass'` instead.
Deprecation Warning: 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