How to use Sass with Vite & Bun
09:19 20 Oct 2024

I am trying to do it according to the instructions, but I am getting this error: Error screenshot

[plugin:vite:css] Preprocessor dependency "sass-embedded" not found. Did you install it? Try `bun add -D sass-embedded`.

The hint is not clear for me. I have tried the two commands below, which include the suggested command.

- bun install -D sass
- bun add -D sass-embedded

It is still not working. How should I proceed:

For additional information, here is my package.json:

{
  "name": "test-sass",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "bunx --bun vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "sass": "^1.80.3",
    "sass-embedded": "^1.80.3",
    "vite": "^5.4.8"
  }
}

How can I install correctly?

sass frontend vite bun