Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to use vitePreprocess with global SCSS mixins in SvelteKit?

$
0
0

In my SvelteKit project I am using SCSS and in order to include some mixins that are used throughout the project, I switched from vitePreprocess to svelte-preprocess and prepended them with scss.prependData. Now my config looks like this:

const config = {  preprocess: preprocess({    scss: {      prependData: `@import './src/styles/prepend.scss';`,    },  }),  // ..  // Other options not relevant to the question}

Since the official SvelteKit docs suggest that vitePreprocessmight be faster, I was wondering if I can set up global mixins with it.

I tried importing prepend.scss in my root +layout.svelte file but now I'm getting an Undefined mixin error.

Can I use mixins with vitePreprocess or is svelte-preprocess the only way to achieve this at the moment?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>