66 <PreserveCompilationContext >true</PreserveCompilationContext >
77 <TypeScriptCompileBlocked >true</TypeScriptCompileBlocked >
88 <PackageTargetFallback >$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback >
9- <GlobalExclude >$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj</GlobalExclude >
9+ <GlobalExclude >$(GlobalExclude);bin\**;obj\**;node_modules\**;**\*.user;**\*.suo;**\*.*proj;.git\** </GlobalExclude >
1010 </PropertyGroup >
1111 <ItemGroup >
1212 <None Include =" **\*" Exclude =" $(GlobalExclude)" />
6868 <!-- Files not to show in IDE -->
6969 <None Remove =" .bowerrc" />
7070 <None Remove =" yarn.lock" />
71- </ItemGroup >
72- <ItemGroup >
73- <!-- Only publish ClientApp\dist\**, but tell IDE to show all of ClientApp\** in Solution Explorer -->
71+
72+ <!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
7473 <Content Remove =" ClientApp\**" />
75- <Content Include =" ClientApp\**" Exclude =" ClientApp\dist\**" >
76- <CopyToPublishDirectory >Never</CopyToPublishDirectory >
77- </Content >
78- <Content Include =" ClientApp\dist\**" >
79- <CopyToPublishDirectory >PreserveNewest</CopyToPublishDirectory >
80- </Content >
8174 </ItemGroup >
82- <Target Name =" RunWebpack" AfterTargets =" PrepareForPublish " >
75+ <Target Name =" RunWebpack" AfterTargets =" ComputeFilesToPublish " >
8376 <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
8477 <Exec Command =" npm install" />
8578 <Exec Command =" node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
8679 <Exec Command =" node node_modules/webpack/bin/webpack.js --env.prod" />
80+
81+ <!-- Include the newly-built files in the publish output -->
82+ <ItemGroup >
83+ <DistFiles Include =" wwwroot\dist\**; ClientApp\dist\**" />
84+ <ResolvedFileToPublish Include =" @(DistFiles->'%(FullPath)')" Exclude =" @(ResolvedFileToPublish)" >
85+ <RelativePath >%(DistFiles.Identity)</RelativePath >
86+ <CopyToPublishDirectory >PreserveNewest</CopyToPublishDirectory >
87+ </ResolvedFileToPublish >
88+ </ItemGroup >
8789 </Target >
8890</Project >
0 commit comments