-
Notifications
You must be signed in to change notification settings - Fork 28
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
Sass watcher Suport for Blazor WASM #68
Comments
Hi, @luckyluggi , the problem has been addressed in #51 , and you can use package version 1.50.0 or later. |
Ok thanks for the info. I've just tried it. It works with Visual studio, but when i run it with dotnet watch i always get the following error: i have this in the Program.js:
and this in the sasscompiler.json
|
Here is an example project showing the problem: Repro steps:
|
Hi, I am not sure if I am understanding it correctly. I am using VS 2022 and I placed my SASS files within the Styles folder, but they are only compiled after a manual rebuild of the project. Is it supposed to be like this? I was expecting it to automatically compile into CSS upon saving the SASS files. |
As far as I know this isn't currently possible in Blazor Wasm projects. In the ASP.NET Core version we spawn a process that watches the files. But because Blazor Wasm runs in the browser this isn't possible. I've looked at dotnet-watch and can add the .scss extension as hot-reloadable, but it will only see it as static files and I didn't see a way to change that. Using Ctrl+R in the dotnet-watch terminal window does work as that will trigger a new build, which in turn triggers the scss compiler msbuild task. |
It is actually possible to get the watcher (that starts for your server project) to work with the WASM client, with a little trick. My server project folder is in a folder at the same level as the client project folder, so eg. The paths in ScopedCssFolders are relative to
I'm extremely new to Blazor but this seems pretty straightforward. Obviously you can add more relative folders as needed. |
Is your feature request related to a problem? Please describe.
Sass watcher is currently only supported for Blazor Server
Describe the solution you'd like
It would be Great if it would also be supported for Blazor WASM
Describe alternatives you've considered
Currently i am running a sass watcher plugin in vscode.
I have not found a solution to watch the sass files in Visual Studio for now.
I could also watch the sass files in a terminal using comand line sass. But it would of course be great if it would just do that automatically in visual studio using this compiler too.
The text was updated successfully, but these errors were encountered: