question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add hot reload to imported SCSS files on SvelteKit

See original GitHub issue

As we chatted about it on Discord, that would be very cool to have HMR on a global SCSS file for SvelteKit like that:

// $layout.svelte
<style lang="scss" global>
    @import "../style/style.scss";
</style>

Right now it doesn’t seem to hot reload the changes when changing an imported SCSS file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
LeonardoBrandaocommented, Apr 17, 2021

I got it working by importing the svelte-preprocess in the svelte.config.cjs file and using it like this:

const sveltePreprocess = require('svelte-preprocess');
module.exports = {
	kit: {
		// other options
	},
	preprocess: sveltePreprocess()
};
1reaction
Easy-Cloud-incommented, Apr 15, 2021

Svelte-Kit now use vite.js for packing, how to use scss config in vite.js?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add SCSS or SASS to SvelteKit - Hao's learning log
In this blog post, we'll go over the simplest way to achieve this. For people who are new to Svelte or SvelteKit, the...
Read more >
hot reloading doesn't work on styles "text/sass" with @import #71
Started here: rollup-plugin-svelte. The problem: I have a component using sass styles with svelte-preprocess like this: when contents of ...
Read more >
SVELTE KIT TUTORIAL #4 - Adding SCSS - YouTube
In this video we discuss how to add SCSS to a SvelteKit project. https://www.barrymichaeldoyle.com Like Subscribe Hit The Bell...
Read more >
Hot Content Reload with SvelteKit & Contentful
Whenever an edit is made, e.g. editing a field or adding a page, we instruct the dev server to let the client-side know...
Read more >
Configuration • Docs • SvelteKit
Your project's configuration lives in a svelte.config.js file at the root of your project. ... import adapter from '@sveltejs/adapter-auto';.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found