Svelte Js with Scss
css-in-readme

Adding Scss to Svelte Js

Installation

Install Svelte with vite

  npm create vite@latest
  Project name : project
  Framework : SvelteJs
  Language : JavaScript
  cd project
  npm i
  npm i svelte-preprocess node-sass --save--dev
  npm i sass --save--dev

Edti vite.config.js

    import { defineConfig } from 'vite'
    import { svelte } from '@sveltejs/vite-plugin-svelte'
    import { sveltePreprocess } from 'svelte-preprocess/dist/autoProcess'

    // https://vitejs.dev/config/
    export default defineConfig({
    plugins: [svelte({
        preprocess: sveltePreprocess()
    })],
    })

Restart the VS-Code and Run the Command

  npm run dev

Project : Localhost:5173

package.json Code :

Running on port : 5173

Scss Code in App.svelte

Top categories

Loading Svelte Themes