Skip to content

Commit 991e81b

Browse files
authored
fix: npm working directory for server and wasm (#191)
1 parent 8046c22 commit 991e81b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.template.config/templates/server/AntDesign.Pro.Template.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
</ItemGroup>
1515

1616
<!--#if (UseNodeJS) -->
17-
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SolutionDir)node_modules') ">
17+
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(ProjectDir)node_modules') ">
1818
<!-- Ensure Node.js is installed -->
1919
<Exec Command="node --version" ContinueOnError="true">
2020
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
2121
</Exec>
2222
<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." />
2323
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
24-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm install" />
24+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" />
2525
</Target>
2626

27-
<Target Name="DebugRunGulp" BeforeTargets="DebugEnsureNodeEnv" Condition=" '$(Configuration)' == 'Debug' And Exists('$(SolutionDir)node_modules') ">
28-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm run gulp:pro" />
27+
<Target Name="DebugRunGulp" BeforeTargets="DebugEnsureNodeEnv" Condition=" '$(Configuration)' == 'Debug' And Exists('$(ProjectDir)node_modules') ">
28+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm run gulp:pro" />
2929
</Target>
3030

3131
<Target Name="PublishRunGulp" AfterTargets="ComputeFilesToPublish">
32-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm install" />
33-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm run gulp:pro" />
32+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" />
33+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm run gulp:pro" />
3434
</Target>
3535
<!--#endif -->
3636
</Project>

.template.config/templates/wasm/AntDesign.Pro.Template.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@
1616
</ItemGroup>
1717

1818
<!--#if (UseNodeJS) -->
19-
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition="'$(Configuration)' == 'Debug' And !Exists('$(SolutionDir)node_modules') ">
19+
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition="'$(Configuration)' == 'Debug' And !Exists('$(ProjectDir)node_modules') ">
2020
<!-- Ensure Node.js is installed -->
2121
<Exec Command="node --version" ContinueOnError="true">
2222
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
2323
</Exec>
2424
<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." />
2525
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
26-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm install" />
26+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" />
2727
</Target>
2828

29-
<Target Name="DebugRunGulp" BeforeTargets="DebugEnsureNodeEnv" Condition=" '$(Configuration)' == 'Debug' And Exists('$(SolutionDir)node_modules') ">
30-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm run gulp:pro" />
29+
<Target Name="DebugRunGulp" BeforeTargets="DebugEnsureNodeEnv" Condition=" '$(Configuration)' == 'Debug' And Exists('$(ProjectDir)node_modules') ">
30+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm run gulp:pro" />
3131
</Target>
3232

3333
<Target Name="PublishRunGulp" AfterTargets="ComputeFilesToPublish">
34-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm install" />
35-
<Exec WorkingDirectory="$(SolutionDir)" Command="npm run gulp:pro" />
34+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" />
35+
<Exec WorkingDirectory="$(ProjectDir)" Command="npm run gulp:pro" />
3636
</Target>
3737
<!--#endif -->
3838
</Project>

0 commit comments

Comments
 (0)