Repository navigation
Replies: 1 comment
|
You don't need to manually keep two terminals open when developing an ASP.NET Core or Blazor application with Tailwind CSS. The simplest solution is to create one development command that starts both watchers. For Tailwind CSS v4, install the CLI: npm install -D tailwindcss @tailwindcss/cli concurrentlyCreate an input stylesheet, for example @import "tailwindcss";Then add a development script to {
"scripts": {
"css:watch": "tailwindcss -i ./Styles/app.css -o ./wwwroot/css/app.css --watch",
"css:build": "tailwindcss -i ./Styles/app.css -o ./wwwroot/css/app.css --minify",
"dev": "concurrently \"dotnet watch run\" \"npm run css:watch\""
}
}Now you only need: npm run devBoth processes run together in the same terminal. For production, integrate Two details matter:
For larger projects, you can also use an MSBuild target to generate CSS as part of the .NET build. I would start with the single This is a development workflow issue rather than a limitation of Tailwind itself. |
Uh oh!
There was an error while loading. Please reload this page.
It's very hard to integrate tailwind CSS into a .net core application. as a fresher, I started with tailwind CSS as my styling approach in React and many frontend frameworks It runs automatically but in .net core, I have to run 2 command consoles for working. I hope it is easy to integrate and I don't want to run 2 separate commands for watching CSS building.
All reactions