Skip to content

How to preload stylesheet in development mode? #81

Answered by ElMassimo
priosshrsth asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Prios!

This could be related to #48, in the sense that Vite will only inject CSS that way during development, but in production the stylesheet would be preloaded instead.

You could try shutting down the Vite development server temporarily while developing the progress bar feature. This will cause assets to be compiled and to load as the would in production, the only downside is that it would rebuild every time you change assets.

Another option would be to use vite_stylesheet_tag to render a link tag instead, and create a separate stylesheet that contains the styles you need for the progress bar.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@priosshrsth
Comment options

@ElMassimo
Comment options

@priosshrsth
Comment options

Answer selected by ElMassimo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants