Skip to content

Commit 91024ad

Browse files
committed
fix: Remove watch flag
1 parent bd92520 commit 91024ad

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

DotnetDevKR.TailwindCSS.Compile/TailwindCSSCompiler.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ public async Task CompileAsync(
1515
string OutputFilename,
1616
string ProjectDir,
1717
bool isMinify = false,
18-
bool isDebug = false,
19-
bool watch = false
18+
bool isDebug = false
2019
)
2120
{
2221
var process = CreateTailwindCSSProcess(
2322
MSBuildThisFileDirectory,
2423
$"-i {InputFilename} -o {OutputFilename} --cwd {ProjectDir}" +
2524
(isMinify ? " --minify" : "") +
26-
(isDebug ? " --map" : "") +
27-
(watch ? " --watch" : "")
25+
(isDebug ? " --map" : "")
2826
);
2927

3028
var errorOutput = new MemoryStream();

DotnetDevKR.TailwindCSS/TailwindCSSTask.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class TailwindCSSTask : Microsoft.Build.Utilities.Task
1515
public string MSBuildThisFileDirectory { get; set; }
1616
public bool IsMinify { get; set; } = false;
1717
public bool DebugMode { get; set; } = false;
18-
public bool DotNetWatch { get; set; } = false;
1918

2019
public override bool Execute()
2120
{
@@ -32,8 +31,7 @@ public override bool Execute()
3231
OutputFilename,
3332
ProjectDir,
3433
IsMinify,
35-
DebugMode,
36-
DotNetWatch
34+
DebugMode
3735
).GetAwaiter().GetResult();
3836

3937
return !Log.HasLoggedErrors;

DotnetDevKR.TailwindCSS/build/DotnetDevKR.TailwindCSS.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@
66
Pack="true"
77
Visible="false" />
88
</ItemGroup>
9+
10+
<ItemGroup>
11+
<Watch Include="**\*.razor" AlwaysRebuild="true" />
12+
<Watch Include="**\*.html" AlwaysRebuild="true" />
13+
<Watch Include="**\*.cshtml" AlwaysRebuild="true" />
14+
<Watch Include="**\*.cs" AlwaysRebuild="true" />
15+
</ItemGroup>
916
</Project>
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<Project>
22
<ItemGroup>
33
<CompilerVisibleProperty Include="ProjectDir" />
4-
<CompilerVisibleProperty Include="DotnetWatch" />
54
</ItemGroup>
65
<UsingTask TaskName="TailwindCSSTask" AssemblyFile="$(MSBuildThisFileDirectory)..\lib\net6.0\DotnetDevKR.TailwindCSS.dll" />
7-
<Target Name="RunTailwindCSSTask" BeforeTargets="Build">
6+
<Target
7+
Name="RunTailwindCSSTask"
8+
BeforeTargets="Build"
9+
Inputs="@(Watch);$(InputFilename)"
10+
Outputs="$(OutputFilename)">
11+
812
<Message Text="Running Tailwind CSS task..." Importance="high" />
913
<TailwindCSSTask
1014
MSBuildThisFileDirectory="$(MSBuildThisFileDirectory)"
1115
InputFilename="$(InputFilename)"
1216
OutputFilename="$(OutputFilename)"
1317
IsMinify="$(IsMinify)"
1418
DebugMode="$(DebugMode)"
15-
ProjectDir="$(ProjectDir)"
16-
DotNetWatch="$(DotNetWatch)" />
19+
ProjectDir="$(ProjectDir)" />
1720
</Target>
1821
</Project>

0 commit comments

Comments
 (0)