Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

CSS in public seems to be obliterated when live reloading does its thing #108

Closed
JohnnyLaRue opened this issue Jan 23, 2020 · 7 comments
Closed
Labels

Comments

@JohnnyLaRue
Copy link

I'm evaluating Svelte for an upcoming project and in simply playing around with an application I downloaded via the REPL I have noticed an extremely annoying behavior when live reloading in dev mode.

I want my CSS to live in CSS files both because I don't want Svelte touching my selectors (see sveltejs/svelte#3104) and because the notion of single file components is incompatible with the way my cross-functional team implements and maintains style guides.

If I make changes to /public/global.css and save them then these changes are reflected in the browser window exactly as expected.

If I then make any change to my actual component .svelte file, everything in /public/global.css seems to completely disappear until I go make a nonsense change there and save it again. Manually refreshing the page does not do anything to help. This is extremely annoying and makes development rather tedious.

As I am a newcomer to both Svelte and Rollup, I am uncertain as to whether this is something to be expected with the default config coming out of the REPL's download button, a genuine bug, or merely an "opinion" being expressed by the framework. It's perfectly fine if it is, I just need to know so I can make a call as to whether or not we can work with Svelte.

@Conduitry Conduitry transferred this issue from sveltejs/svelte Jan 23, 2020
@Conduitry
Copy link
Member

Transferring this from the svelte repo to the template repo.

That said, I can't reproduce this.

@chapmanjacobd
Copy link

this is how it is supposed to work right? /public or /dist is usually a temporary directory. if you want to source a CSS file then it should be stored in /src or another folder

I'm not 100% sure about svelte but this is how it works in other hot-reload situations

@Conduitry
Copy link
Member

public/build/bundle.css is where the bundled CSS from all of the Svelte components goes. public/global.css should be entirely untouched by the build process, and, as far as I can tell, it is.

@Conduitry
Copy link
Member

Closing due to inactivity.

@JohnnyLaRue
Copy link
Author

Closing due to inactivity.

The development cadence of the project led us to surmise that a similar statement would be appearing on the repository's front page in the not too distant future. It's a really interesting idea and I hope someone with more resources explores it further some day.

@Conduitry
Copy link
Member

The development cadence of the project led us to surmise that a similar statement would be appearing on the repository's front page in the not too distant future.

tee fucking hee

@AnatoleLucet
Copy link

This issue happened to me yesterday. Strangely after a good night of sleep the issue disappeared...
Yesterday, I've tried to restart my linux vm but it didn't fix it. So, if you have this issue you may try to fully restart your computer (yes, it sounds like something that a novice would say). There's probably a cleaner way to fix this, meh it worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants