Not always working hot-reloading on Vue with Tailwind CSS imported from <style> in component
#2426
Unanswered
liborjelinek
asked this question in
Discussion
Replies: 1 comment 1 reply
|
What about this ? // pages/+Head.vue
<template>
<link rel="stylesheet" :href="tailwindCss" />
</template>
<script setup lang="ts">
import * as tailwindCss from "../layouts/tailwind.css";
</script>
This only happens with the preview build, right? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Vikers,
I started with
npm create vike@latest --- --vue --tailwindcssbut have realized that changes to Tailwind classes in<template>s (e.g.,<p class="mr-4">aren't reliably refreshed byvike dev... Sometimes, I need to F5 or restartvike dev.The above template connects Vue and Tailwind file by importing in
LayoutDefault.vue's<style>.The Tailwind docs on installing with Vite chooses to put it in the HTML head.
I tried adding it to
pages/+Head.vue, and it works perfectly now. Every change to HTML classes is not reliably hot-reloaded.What is the experience of others, Vikers?
UPDATE: I have found that the above approach causes a 404 for the style URL.
All reactions