|
12 | 12 | <IsPackable>true</IsPackable> |
13 | 13 | <ImplicitUsings>enable</ImplicitUsings> |
14 | 14 | <Nullable>enable</Nullable> |
15 | | - <SpaRoot>ClientApp\</SpaRoot> |
| 15 | + <SpaRoot>ClientApp</SpaRoot> |
16 | 16 | </PropertyGroup> |
17 | 17 |
|
18 | 18 | <ItemGroup> |
19 | 19 | <!-- Don't publish the SPA source files, but do show them in the project files list --> |
20 | | - <Content Remove="$(SpaRoot)**"/> |
21 | | - <None Remove="$(SpaRoot)**"/> |
22 | | - <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**"/> |
| 20 | + <Content Remove="$(SpaRoot)\**"/> |
| 21 | + <None Remove="$(SpaRoot)\**"/> |
| 22 | + <None Include="$(SpaRoot)\**" Exclude="$(SpaRoot)\node_modules\**"/> |
23 | 23 | </ItemGroup> |
24 | 24 |
|
25 | | - <Target Name="NpmInstall" BeforeTargets="Build" Condition="!Exists('$(SpaRoot)node_modules')"> |
| 25 | + <Target Name="NpmInstall" BeforeTargets="Build" Condition="!Exists('$(SpaRoot)\node_modules')"> |
26 | 26 | <!-- Ensure Node.js is installed --> |
27 | 27 | <Exec Command="node --version" ContinueOnError="true" EchoOff="true"> |
28 | 28 | <Output TaskParameter="ExitCode" PropertyName="ErrorCode"/> |
29 | 29 | </Exec> |
30 | 30 | <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE."/> |
31 | 31 | <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..."/> |
32 | | - <Exec WorkingDirectory="$(SpaRoot)" Command="npm install"/> |
| 32 | + <Exec WorkingDirectory="$(SpaRoot)\" Command="npm install"/> |
33 | 33 | </Target> |
34 | 34 |
|
35 | 35 | <Target Name="NpmRunBuild" BeforeTargets="Build" DependsOnTargets="NpmInstall"> |
36 | | - <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build"/> |
| 36 | + <Exec WorkingDirectory="$(SpaRoot)\" Command="npm run build"/> |
37 | 37 | </Target> |
38 | 38 |
|
39 | 39 | <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish"> |
40 | | - <!-- As part of publishing, ensure the JS resources are freshly built in production mode --> |
41 | | - <Exec WorkingDirectory="$(SpaRoot)" Command="npm install"/> |
42 | | - <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build"/> |
43 | | - |
44 | | - <!-- Include the newly-built files in the publish output --> |
45 | | - <ItemGroup> |
46 | | - <DistFiles Include="$(WWWRoot)\**"/> |
47 | | - <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"> |
48 | | - <RelativePath>%(DistFiles.Identity)</RelativePath> |
49 | | - <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
50 | | - <ExcludeFromSingleFile>true</ExcludeFromSingleFile> |
51 | | - </ResolvedFileToPublish> |
52 | | - </ItemGroup> |
| 40 | + <Exec WorkingDirectory="$(SpaRoot)\" Command="npm install"/> |
| 41 | + <Exec WorkingDirectory="$(SpaRoot)\" Command="npm run build"/> |
53 | 42 | </Target> |
54 | 43 |
|
55 | 44 | <Target Name="NpmClean" BeforeTargets="Clean"> |
56 | 45 | <RemoveDir Directories="$(WWWRoot)"/> |
57 | | - <RemoveDir Directories="$(SpaRoot)node_modules"/> |
| 46 | + <RemoveDir Directories="$(SpaRoot)\node_modules"/> |
58 | 47 | </Target> |
59 | 48 |
|
60 | 49 | <ItemGroup> |
|
0 commit comments