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
P粉3453027532024-01-29 19:42:06
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
P粉0769873862024-01-29 16:38:27
$ 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
],
})