Answer the question
In order to leave comments, you need to log in
How to use Sass in Vue 3?
Project on Vue 3 with Typescript
I can't connect sass, style files are not visible. I need scss files to be visible globally
. What I tried to do:
1. Created a vue.config, js file in the root of the project and added it to it
css: {
loaderOptions: {
sass: {
additionalData: `
@import "@/assets/scss/styles.scss";
`
}
}
}
@import "global";
@import "variables";
@import "fonts";
Answer the question
In order to leave comments, you need to log in
Variables and mixins are imported into additionalData.
We write styles in styles.scss, import other files (variables and mixins are not required, but will not interfere).
Styles.scss itself is imported at the client entry point (main.js by default, it seems, if without SSR).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question