6
6
<PreserveCompilationContext >true</PreserveCompilationContext >
7
7
<TypeScriptCompileBlocked >true</TypeScriptCompileBlocked >
8
8
<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 >
10
10
</PropertyGroup >
11
11
<ItemGroup >
12
12
<None Include =" **\*" Exclude =" $(GlobalExclude)" />
68
68
<!-- Files not to show in IDE -->
69
69
<None Remove =" .bowerrc" />
70
70
<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) -->
74
73
<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 >
81
74
</ItemGroup >
82
- <Target Name =" RunWebpack" AfterTargets =" PrepareForPublish " >
75
+ <Target Name =" RunWebpack" AfterTargets =" ComputeFilesToPublish " >
83
76
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
84
77
<Exec Command =" npm install" />
85
78
<Exec Command =" node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
86
79
<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 >
87
89
</Target >
88
90
</Project >
0 commit comments