How do we use NUXT3 with sass, please share the documentation too.
I tried adding sass to the nuxt3 project, but vite doesn't seem to have the option to load scss
Same as a normal vue or vite project, you need to install it as follows
// .scss and .sass npm add -D sass // .less npm add -D less // .styl and .stylus npm add -D stylus
But you need to define the css or scss file in nuxt.config.ts, As shown in the following example
css: [ // CSS file in the project '@/assets/css/main.css', // SCSS file in the project '@/assets/css/main.scss' ]
https://nuxt.com/docs/api/configuration/nuxt -config#css
$ yarn add sass sass-loader --dev # or $ npm install sass sass-loader --save-dev
// nuxt.config.ts export default defineNuxtConfig({ // more css: [ // SCSS file in the project "~/assets/style/main.scss", // you should add main.scss somewhere in your app ], })
Same as a normal vue or vite project, you need to install it as follows
But you need to define the css or scss file in nuxt.config.ts, As shown in the following example
https://nuxt.com/docs/api/configuration/nuxt -config#css
Install first and save as devDependency
>Configure whether to use global scss
In your component