Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: impossible to use the "css" key config (available in vitejs config) in the tuono.config.ts file #504

Closed
spacecodeur opened this issue Feb 4, 2025 · 3 comments · Fixed by #518
Assignees
Labels
bug Something isn't working

Comments

@spacecodeur
Copy link
Contributor

Description

In a tuono project, I added the sass npm package in my package.json :

{
  ...
  "dependencies": {
    ...
    "sass": "^1.83.0",
    ...
  },
}

But when I run tuono dev I got this annoying warning :

Deprecation Warning [legacy-js-api]: 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

After some search, it seems one the best solution is to add theses lines in the vite config file :

css: {
    preprocessorOptions: {
        scss: {
            api: 'modern-compiler' // or "modern"
        }
    }
},

But its currently impossible to use the css entry in the tuono.config.ts file

Expected behaviour

I'm looking for use the sass package without deprecated message ;)

How to reproduce

  • create a new tuono project (tuono cli version 0.17.6)
  • add the package sass with the command npm i sass (or npm i --save-dev sass)
  • run the command npm i then tuono dev

The warning appears :

Deprecation Warning [legacy-js-api]: 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

Screenshots

No response

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
    Memory: 49.07 GB / 62.55 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 22.10.0 - /usr/local/node/bin/node
    npm: 10.9.0 - /usr/local/node/bin/npm
  npmPackages:
    tuono: 0.17.6 => 0.17.6

System info (Rust)

rustc 1.83.0 (90b35a623 2024-11-26)
cargo 1.83.0 (5ffbef321 2024-10-29)
tuono 0.17.6

Additional context

No response

@spacecodeur spacecodeur added the bug Something isn't working label Feb 4, 2025
@jacobhq
Copy link
Member

jacobhq commented Feb 4, 2025

Happy to work on this one in a PR :)

@jacobhq
Copy link
Member

jacobhq commented Feb 7, 2025

Thank you for your comprehensive description. Your work around is correct, and I have just implemented support for the vite.css key in tuono config. For now, tuono uses vite 5, however when we upgrade to vite 6, you will be able to remove this, as vite 6 uses it by default. We will include a note in the release notes when we upgrade :)

@spacecodeur
Copy link
Contributor Author

spacecodeur commented Feb 8, 2025

Thanks for your work :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants