New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vite] TailwindCSS 2.2 JIT no longer tracks updated Svelte files #67
Comments
Can confirm I'm running into this issue as well. |
@GrygrFlzr Windows fix might have just been checked in - vitejs/vite@41b193c |
Putting const mode = process.env.NODE_ENV;
const dev = mode === "development";
process.env.TAILWIND_MODE = dev ? "watch" : "build"; in
Is that a Windows or WSL thing? I have always had working HMR (or at least what I think is HMR) with Tailwind JIT. |
Also note that due to svelte-add/tailwindcss#58, this project currently isn't able to produce a JIT Tailwind setup because |
Alternatively, sveltejs/kit#1715 |
I just want to mention that with vite 2.4+, tw JIT does not properly work without the mentioned code above. (Freshly installed sveltekit example with tailwind) |
|
Ah ok, I somehow assumed that vite 2.4 should fix it 🙈 |
Since 2.2 (tailwindlabs/tailwindcss#4514) the JIT engine switches to using the "tracking" context by default instead of "watching" context, which requires support in Vite. There's an issue about this filed at tailwindlabs/tailwindcss#4683 but I figure it's good to track this here as well.
Current workarounds:
TAILWIND_MODE=watch
env var, which is ugly and not cross-platform withoutcross-env
, and apparently doesn't trigger HMRnpm-run-all
Proper Fix:
vitejs/vite@6eaec3a should in theory fix this, although I can confirm that the CI failing tests on Windows is not a fluke, I can replicate it on my machine.
The text was updated successfully, but these errors were encountered: