Replies: 1 comment 3 replies
-
Hi Kevin! FOUC in development is expected if you are importing styles from JS, as the browser won't block rendering waiting for the scripts to load (module scripts are always If you'd like to avoid FOUC in development, you can use Vite's support for CSS sourcemaps in development is experimental, and can be enabled in export default defineConfig({
css: { devSourcemap: true },
}) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm migrating from sprockets, skipped esbuild so my apologies if there's something I'm not getting.
I've gotten my site working by importing the css from the application.js, like import '../stylesheets/cats.css'. I do see a flash of unstyled site though before the CSS are loaded (at least in development, haven't tested production)
Chrome devtools also shows the css as inline to the page, so I can't see what file the style comes from when debugging.
I also had a version working where I used sass to @import each file.
But then chrome devtools shows the 'source' as the big application.sass base file, rather than the original file.
Thanks for a great project :)
Beta Was this translation helpful? Give feedback.
All reactions