Vue 3 Convert scss to css

839 Views Asked by At

I want to create a css file from scss and this file has to save the changes after i stop writing.

Where do I have to define it in Vite and how to do it? I am using Vue 3.

1

There are 1 best solutions below

3
Nicola Spadari On

With Vite you can just npm i -D sass, create a style.scss file for example in the src/assets/styles folder.
If you need to add it globally, just include it in your main.js/.ts file like:

@import "@/assets/styles/style.scss"

Otherwise add the same line in the component <style lang="scss" scoped> tag.