-
Notifications
You must be signed in to change notification settings - Fork 30
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
Can only get to work using as a Tool #17
Comments
Hi @michael-kaufman,
I don't understand what you mean by that. This is literally a dotnet tool, so I don't know what else you would like to use it as.
There isn't. You are looking for
I am not familiar with dotnet watch, so can't help with that. Sorry! I'm sure you can write <Target Name="CompileStaticAssets" AfterTargets="CoreCompile">
<Exec Command="dotnet tool run webcompiler ..." StandardOutputImportance="high" />
</Target> The exact config is up to you, and maybe
This is literally what
That's very much out of scope for webcompiler. As far as I know, you could probably achieve that with Hope that helps |
Hi Stefan,
Thank you!! That gives me new things to try. Thanks very much for the fast
response too!! I am not really a .net developer but way more a .js guy
which is probably why I'm having problems. You're right about the Tool.
Sorry, I worded that wrong. I meant I can only get it to work on the
command line but not in the build or on saving. I am going to try different
things now. I really appreciate the help.
Michael.
…On Mon, Oct 26, 2020 at 1:27 PM Stefan Lörwald ***@***.***> wrote:
Hi @michael-kaufman <https://github.com/michael-kaufman>,
It's great but I can only get this to work as a Tool.
I don't understand what you mean by that. This is literally a dotnet tool,
so I don't know what else you would like to use it as.
Also, there's an issue that when you supply an output directory.
There isn't. You are looking for --preserve disable to not preserve the
intermediate files. This comes at a downside of increased compile time, as
there is less caching.
1. Can it be used in a watch AND on Save AND in the build
simultaneously? I can only get it to work as a Tool and a Watcher.
I am not familiar with dotnet watch, so can't help with that. Sorry! I'm
sure you can write MSBuild targets to enable "build on save". The
important bit will be to find out which Target to make your Target depend
on.
Maybe you want something like
<Target Name="CompileStaticAssets" AfterTargets="CoreCompile">
<Exec Command="dotnet tool run webcompiler ..." StandardOutputImportance="high" />
</Target>
The exact config is up to you, and maybe CoreCompile is not the right
target for you. Not sure..
1. Why does it only work recursively, using the -r flag?
This is literally what -r means. It is equivalent to --recursive. If we
were to recurse without that flag, many people would be annoyed because
they don't actually want that.
1. Is there a way to make it auto refresh the page after it converts
files? I tried with LiveReload, but it seems to break everything.
That's very much out of scope for webcompiler. As far as I know, you could
probably achieve that with dotnet watch, by adding the output files to
the watch.
Hope that helps
Stefan
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMLJ7XOCYICCVMFNOIQ45LSMXERLANCNFSM4S7ZGWYQ>
.
|
Stefan,
I got it working using AfterTargets="Compile". And it works with LiveReload
too. So now I make a CSS change and hit Save and it takes care of
refreshing the page. Thanks for the perfect tool!!
Best,
MK
On Mon, Oct 26, 2020 at 1:45 PM Michael Kaufman <mkaufmandev@gmail.com>
wrote:
… Hi Stefan,
Thank you!! That gives me new things to try. Thanks very much for the fast
response too!! I am not really a .net developer but way more a .js guy
which is probably why I'm having problems. You're right about the Tool.
Sorry, I worded that wrong. I meant I can only get it to work on the
command line but not in the build or on saving. I am going to try different
things now. I really appreciate the help.
Michael.
On Mon, Oct 26, 2020 at 1:27 PM Stefan Lörwald ***@***.***>
wrote:
> Hi @michael-kaufman <https://github.com/michael-kaufman>,
>
> It's great but I can only get this to work as a Tool.
>
> I don't understand what you mean by that. This is literally a dotnet
> tool, so I don't know what else you would like to use it as.
>
> Also, there's an issue that when you supply an output directory.
>
> There isn't. You are looking for --preserve disable to not preserve the
> intermediate files. This comes at a downside of increased compile time, as
> there is less caching.
>
>
> 1. Can it be used in a watch AND on Save AND in the build
> simultaneously? I can only get it to work as a Tool and a Watcher.
>
> I am not familiar with dotnet watch, so can't help with that. Sorry! I'm
> sure you can write MSBuild targets to enable "build on save". The
> important bit will be to find out which Target to make your Target
> depend on.
> Maybe you want something like
>
> <Target Name="CompileStaticAssets" AfterTargets="CoreCompile">
> <Exec Command="dotnet tool run webcompiler ..." StandardOutputImportance="high" />
> </Target>
>
> The exact config is up to you, and maybe CoreCompile is not the right
> target for you. Not sure..
>
>
> 1. Why does it only work recursively, using the -r flag?
>
> This is literally what -r means. It is equivalent to --recursive. If we
> were to recurse without that flag, many people would be annoyed because
> they don't actually want that.
>
>
> 1. Is there a way to make it auto refresh the page after it converts
> files? I tried with LiveReload, but it seems to break everything.
>
> That's very much out of scope for webcompiler. As far as I know, you
> could probably achieve that with dotnet watch, by adding the output
> files to the watch.
>
> Hope that helps
> Stefan
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#17 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAMLJ7XOCYICCVMFNOIQ45LSMXERLANCNFSM4S7ZGWYQ>
> .
>
|
Hi. Thank you for the tool. It's great but I can only get this to work as a Tool. I've installed it globally and use it in a Watch using this:
dotnet watch tool run webcompiler -r -z disabled -m disabled -o wwwroot/converted Styles
Also, there's an issue that when you supply an output directory. It works, but you're left with two versions of the same file. One from where it originated, and another in the output folder.
Questions:
Thanks!
-MK
The text was updated successfully, but these errors were encountered: