Skip to content
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

fix: Watch the Tailwind CSS file too #800

Closed
wants to merge 1 commit into from

Conversation

kikuchan
Copy link

@kikuchan kikuchan commented Feb 3, 2024

In dev mode, when a user specified cssPath in their options, hot reloading the file by Vite is not enough to apply the CSS.

This PR try to resolve the issue by restarting the server.

Copy link

what-the-diff bot commented Feb 3, 2024

PR Summary

  • Added Conditional Statement for Server Restart
    The addition of a new conditional statement now facilitates server restarts when changes are made to the Tailwind CSS file. This ensures the server is always up-to-date with the latest changes in your stylesheets, improving efficiency by removing the need for manual server restarts.

@ineshbose
Copy link
Collaborator

ineshbose commented Feb 3, 2024

Thanks for this PR!

I wonder if this is required, as the CSS is added to nuxt.options.css that should already watch the files for us. In my use cases, changes to my CSS files have worked and show in my Nuxt project. Is it causing issues for you? Perhaps a Stackblitz reproduction would be super helpful!

I do understand that nuxt.options.css targets HMR while nuxt.options.watch targets server restart (which isn't preferable and we want to avoid), so a use-case here could help understand why this may be required. I would believe that we want to leave it out of the module, and up to devs to add it to watch in their nuxt.config.

@kikuchan
Copy link
Author

kikuchan commented Feb 3, 2024

Thank you for your reply!

I'm so sorry, I couldn't reproduce it again anymore...
Perhaps it was my browser's fault or something.
If I found the reproduction, I'll post here.
Thanks again.

@kikuchan kikuchan closed this Feb 3, 2024
Copy link

netlify bot commented Mar 27, 2024

‼️ Deploy request for nuxt-tailwindcss rejected.

Name Link
🔨 Latest commit 97d5aa3

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

Successfully merging this pull request may close these issues.

None yet

2 participants