Skip to content

Commit a7d2b8c

Browse files
committed
refactor: 更改为增量执行
1 parent 154baa7 commit a7d2b8c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/BootstrapBlazor/Directory.Build.targets

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
</ItemGroup>
88

99
<PropertyGroup>
10-
<BootstrapBundleFile>$(MSBuildThisFileDirectory)wwwroot/core/bootstrap/js/bootstrap.bundle.min.js</BootstrapBundleFile>
11-
<TargetBootstrapBundleFile>$(MSBuildThisFileDirectory)wwwroot/js/bootstrap.blazor.bundle.min.js</TargetBootstrapBundleFile>
10+
<BootstrapOriginJsFile>$(MSBuildThisFileDirectory)wwwroot/core/bootstrap/js/bootstrap.bundle.min.js</BootstrapOriginJsFile>
11+
<BootstrapTargetJsFile>$(MSBuildThisFileDirectory)wwwroot/js/bootstrap.blazor.bundle.min.js</BootstrapTargetJsFile>
12+
<StyleFile>$(MSBuildThisFileDirectory)wwwroot/css/bootstrapblazor.min.css</StyleFile>
13+
<BundleStyleFile>$(MSBuildThisFileDirectory)wwwroot/css/bootstrap.blazor.bundle.min.css;$(MSBuildThisFileDirectory)wwwroot/css/bootstrap.blazor.bundle.rtl.min.css</BundleStyleFile>
1214
</PropertyGroup>
1315

14-
<Target Name="CopyCss" AfterTargets="Build" Condition="'$(TargetFramework)' == '$(RunTargetFramework)'">
16+
<Target Name="CopyJs" AfterTargets="Build" Condition="'$(TargetFramework)' == '$(RunTargetFramework)'" Inputs="$(BootstrapOriginJsFile)" Outputs="$(BootstrapTargetJsFile)">
1517
<Message Text="Copy bootstrap.bundle.min.js ..." Importance="high"></Message>
16-
<Copy SourceFiles="$(BootstrapBundleFile)" DestinationFiles="$(TargetBootstrapBundleFile)" SkipUnchangedFiles="true"></Copy>
18+
<Copy SourceFiles="$(BootstrapOriginJsFile)" DestinationFiles="$(BootstrapTargetJsFile)" SkipUnchangedFiles="true"></Copy>
19+
</Target>
1720

21+
<Target Name="Bundler" AfterTargets="CopyJs" Condition="'$(TargetFramework)' == '$(RunTargetFramework)'" Inputs="$(StyleFile)" Outputs="$(BundleStyleFile)">
1822
<Exec Command="dotnet tool restore"></Exec>
1923
<Message Text="Bundler min css ..." Importance="high"></Message>
20-
<Exec Command="dotnet css-bundler .\bundler.json"></Exec>
24+
<Exec Command="dotnet css-bundler .\bundler.json"></Exec>
2125
</Target>
2226

2327
</Project>

0 commit comments

Comments
 (0)