Routify doesn't catch changes in global.css
See original GitHub issueIf I add a rule to global.css, save, and refresh the page, it doesn’t work.
Steps to reproduce
git clone https://github.com/Wolfr/hn-clone-svelte-be.git
npm i
npm run dev
Go to global.css. Add a rule like
* {
background: yellow;
}
Observe that no change happens.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Editing global.css doesn't work · Issue #32 - GitHub
Expected behavior. File is copied over to /dist/global.css with changes. Current result. Nothing happens. The watcher doesn't seem to catch the file change....
Read more >FAQ - Routify
How do I use Routify with Electron? Electron doesn't detect changes in node_modules. To get around that, we can export the generated files...
Read more >Svelte (routify) + rollup: not watching for css changes in /static
I want to be able to watch for changes in /static (for example, on global.css). I am using the following code to watch...
Read more >Svelte SPA routing: Routify tutorial - YouTube
How to use Routify with Svelte for client-side (SPA) routing. Source code: https://bitbucket.org/spinspire/svelte- routify -demo/Index/TOC:00: ...
Read more >2.23 - Routes for Svelte with Routify - YouTube
Jake Rosenberg and Willow join us to talk about Routes for Svelte with ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Using style tags in Svelte files works for small demos and small projects.
The Svelte provided CSS scoping is super nice for exceptions to the general rule in bigger projects and for quick coding of experiments.
The reason to have a separate CSS architecture is
For example, we use the exact same SCSS in our Wordpress version as in our current Svelte version. There’s some definite business benefits in maintaining proper CSS as a separate “thing”.
@Wolfr I’m going off topic here, but is there a reason you don’t use
<style>
tags in.svelte
files? Not a suggestion. Just curiosity.global.css
is a bit of a static file to me. Like an asset. If it were to be used as a dynamic source file instead, it would make more sense to me to import it inmain.js
.In general code should act as one would expect, but what happens when people have different expectations or even wrong expectations. I think the best way to handle these scenarios, is by showing a correct approach.
IMO the current structure reflects what can be expected of Rollup. Files in the static folder are static and changing them won’t cause an update. As often seen in other projects, we could create a
src/assets
folder for css/scss and import it inApp.svelte
. This keeps things simple in the sense thatsrc
is for dynamic content.