Skip to content

Commit

Permalink
fix: npm working directory for server and wasm (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderJames authored Aug 23, 2024
1 parent 8046c22 commit 991e81b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .template.config/templates/server/AntDesign.Pro.Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
</ItemGroup>

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

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

<Target Name="PublishRunGulp" AfterTargets="ComputeFilesToPublish">
<Exec WorkingDirectory="$(SolutionDir)" Command="npm install" />
<Exec WorkingDirectory="$(SolutionDir)" Command="npm run gulp:pro" />
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" />
<Exec WorkingDirectory="$(ProjectDir)" Command="npm run gulp:pro" />
</Target>
<!--#endif -->
</Project>
12 changes: 6 additions & 6 deletions .template.config/templates/wasm/AntDesign.Pro.Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
</ItemGroup>

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

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

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

0 comments on commit 991e81b

Please sign in to comment.