This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
npx tailwindcss .... --watch is locking my files #10163
Comments
Hey! This is definitely weird. We open files temporarily to read them for changes but they should then be closed as soon as the read is done. Can you provide details on:
Visual Studio especially has some super weird quirks that other editors don't exhibit so it's probably something specific to the way it works with files that is causing the problems there. |
Hi, thanks for replying just after christmas :)
I'm wondering if if the problem is because i'm running in debug mode on/off that Visual Studio somehow clashes with the NPX watch. The way i develop is that i'll startup the Blazor app and then edit the Razor / CSHTML files to style up the app. I guess i could try using the Dotnet run method in VSCode instead which seems to work better. |
This comment was marked as spam.
This comment was marked as spam.
Hey! Just getting back around to this (we were off for Christmas break). So a few things:
You can use the "safelist" config option with regexes for this: https://tailwindcss.com/docs/content-configuration#safelisting-classes It does have some caveats though, especially for things involving colors, you should be careful not to make your regex match too much because you'll end up with extremely large CSS files that 1) take a long time to build 2) the browser's can't even handle most of the time. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
I'm running "npx tailwindcss -i ./base.css -o ./wwwroot/app.css --watch" in the root of the folder. and then in order to run the app, you can run this command in Powershell: "dotnet run build" While running the watch in npx - you edit the razor files (/Pages or /Shared) if you edit C# in those files they will force Visual Studio to rebuild or the dotnet runner to "crash" and you then need to restart it. at some point you cant save the file in Visual Studio because it is locked by NPX |
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I've installed the latest version of Tailwind (December 2022) and am using this guide :
https://chrissainty.com/adding-tailwind-css-v3-to-a-blazor-app/
using this command:
npx tailwindcss -i ./app.css -o ./wwwroot/css/app.css --watch
While editing the Blazor files, the Powershell terminal compiles my CSS and is somewhat working fine.
However - at some point i can't save the Razor / CSHTML files in Visual Studio because the files are locked by NPX / Node
I then have to close Powershell / Tailwind builder to save my files.
Ultimately - i would much rather like to work with a pre-compiled subset version of Tailwind but have had a hard time finding the right way to select which features i want. That way i would have functioning Intellisense in Visual Studio.
The text was updated successfully, but these errors were encountered: