Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
Update templates' csproj files to fix first-time publishing (previous…
Browse files Browse the repository at this point in the history
…ly, it didn't deploy dist files if they were not already on disk)
  • Loading branch information
SteveSandersonMS committed Jan 7, 2017
1 parent 8c456aa commit 59526ff
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 28 deletions.
24 changes: 13 additions & 11 deletions templates/Angular2Spa/Angular2Spa.csproj
Expand Up @@ -6,7 +6,7 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj</GlobalExclude>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj;.git\**</GlobalExclude>
</PropertyGroup>
<ItemGroup>
<None Include="**\*" Exclude="$(GlobalExclude)"/>
Expand Down Expand Up @@ -68,21 +68,23 @@
<!-- Files not to show in IDE -->
<None Remove=".bowerrc" />
<None Remove="yarn.lock" />
</ItemGroup>
<ItemGroup>
<!-- Only publish ClientApp\dist\**, but tell IDE to show all of ClientApp\** in Solution Explorer -->

<!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
<Content Remove="ClientApp\**" />
<Content Include="ClientApp\**" Exclude="ClientApp\dist\**">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
<Content Include="ClientApp\dist\**">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<Target Name="RunWebpack" AfterTargets="PrepareForPublish">
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec Command="npm install" />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
13 changes: 11 additions & 2 deletions templates/AureliaSpa/Aurelia.csproj
Expand Up @@ -6,7 +6,7 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj</GlobalExclude>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj;.git\**</GlobalExclude>
</PropertyGroup>
<ItemGroup>
<None Include="**\*" Exclude="$(GlobalExclude)"/>
Expand Down Expand Up @@ -69,10 +69,19 @@
<None Remove=".bowerrc" />
<None Remove="yarn.lock" />
</ItemGroup>
<Target Name="RunWebpack" AfterTargets="PrepareForPublish">
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec Command="npm install" />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
13 changes: 11 additions & 2 deletions templates/KnockoutSpa/KnockoutSpa.csproj
Expand Up @@ -6,7 +6,7 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj</GlobalExclude>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj;.git\**</GlobalExclude>
</PropertyGroup>
<ItemGroup>
<None Include="**\*" Exclude="$(GlobalExclude)"/>
Expand Down Expand Up @@ -69,10 +69,19 @@
<None Remove=".bowerrc" />
<None Remove="yarn.lock" />
</ItemGroup>
<Target Name="RunWebpack" AfterTargets="PrepareForPublish">
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec Command="npm install" />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
24 changes: 13 additions & 11 deletions templates/ReactReduxSpa/ReactReduxSpa.csproj
Expand Up @@ -6,7 +6,7 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj</GlobalExclude>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj;.git\**</GlobalExclude>
</PropertyGroup>
<ItemGroup>
<None Include="**\*" Exclude="$(GlobalExclude)"/>
Expand Down Expand Up @@ -68,21 +68,23 @@
<!-- Files not to show in IDE -->
<None Remove=".bowerrc" />
<None Remove="yarn.lock" />
</ItemGroup>
<ItemGroup>
<!-- Only publish ClientApp\dist\**, but tell IDE to show all of ClientApp\** in Solution Explorer -->

<!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
<Content Remove="ClientApp\**" />
<Content Include="ClientApp\**" Exclude="ClientApp\dist\**">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
<Content Include="ClientApp\dist\**">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<Target Name="RunWebpack" AfterTargets="PrepareForPublish">
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec Command="npm install" />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
13 changes: 11 additions & 2 deletions templates/ReactSpa/ReactSpa.csproj
Expand Up @@ -6,7 +6,7 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj</GlobalExclude>
<GlobalExclude>$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj;.git\**</GlobalExclude>
</PropertyGroup>
<ItemGroup>
<None Include="**\*" Exclude="$(GlobalExclude)"/>
Expand Down Expand Up @@ -69,10 +69,19 @@
<None Remove=".bowerrc" />
<None Remove="yarn.lock" />
</ItemGroup>
<Target Name="RunWebpack" AfterTargets="PrepareForPublish">
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec Command="npm install" />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>

0 comments on commit 59526ff

Please sign in to comment.