|
1 | | -<Project Sdk="Microsoft.NET.Sdk.Web"> |
| 1 | +<Project Sdk="Microsoft.NET.Sdk.Web"> |
2 | 2 |
|
3 | 3 | <PropertyGroup> |
4 | 4 | <TargetFramework>net8.0</TargetFramework> |
| 5 | + <NodeModulesDir>$(ProjectDir)node_modules\</NodeModulesDir> |
| 6 | + <WwwRootDir>$(ProjectDir)wwwroot\</WwwRootDir> |
5 | 7 | </PropertyGroup> |
6 | 8 |
|
7 | | - <Target Name="DebugEnsureNodeEnv" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') "> |
| 9 | + <Target Name="DebugEnsureNodeEnv" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(ProjectDir)node_modules') "> |
8 | 10 | <!-- Ensure Node.js is installed --> |
9 | 11 | <Exec Command="node --version" ContinueOnError="true"> |
10 | 12 | <Output TaskParameter="ExitCode" PropertyName="ErrorCode" /> |
11 | 13 | </Exec> |
12 | 14 | <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." /> |
13 | 15 | <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." /> |
14 | | - <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" /> |
| 16 | + <Exec WorkingDirectory="$(ProjectDir)" Command="npm install" /> |
15 | 17 | </Target> |
16 | | - <Target Name="RunGulp" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And Exists('$(SpaRoot)node_modules') "> |
17 | | - <Exec WorkingDirectory="$(ProjectDir)" Command="node_modules\.bin\gulp add-resources" ContinueOnError="false"> |
18 | | - <Output TaskParameter="ExitCode" PropertyName="ErrorCode" /> |
19 | | - </Exec> |
| 18 | + |
| 19 | + <Target Name="CopyFilesFromNodeModules" BeforeTargets="Build"> |
| 20 | + <ItemGroup> |
| 21 | + <JSFiles Include="$(NodeModulesDir)jquery\dist\jquery.min.js" /> |
| 22 | + <JSFiles Include="$(NodeModulesDir)bootstrap\dist\js\bootstrap.min.js" /> |
| 23 | + <JSFiles Include="$(NodeModulesDir)devextreme-dist\js\dx.all.js" /> |
| 24 | + <JSFiles Include="$(NodeModulesDir)devextreme-dist\js\dx.aspnet.mvc.js" /> |
| 25 | + <JSFiles Include="$(NodeModulesDir)devextreme-aspnet-data\js\dx.aspnet.data.js" /> |
| 26 | + </ItemGroup> |
| 27 | + <Copy SourceFiles="@(JSFiles)" DestinationFolder="$(WwwRootDir)js\" SkipUnchangedFiles="true" /> |
| 28 | + |
| 29 | + <ItemGroup> |
| 30 | + <CSSFiles Include="$(NodeModulesDir)bootstrap\dist\css\bootstrap.css" /> |
| 31 | + <CSSFiles Include="$(NodeModulesDir)devextreme-dist\css\dx.common.css" /> |
| 32 | + <CSSFiles Include="$(NodeModulesDir)devextreme-dist\css\dx.material.blue.light.compact.css" /> |
| 33 | + </ItemGroup> |
| 34 | + <Copy SourceFiles="@(CSSFiles)" DestinationFolder="$(WwwRootDir)css\" SkipUnchangedFiles="true" /> |
| 35 | + |
| 36 | + <ItemGroup> |
| 37 | + <IconFiles Include="$(NodeModulesDir)devextreme-dist\css\icons\**\*" /> |
| 38 | + </ItemGroup> |
| 39 | + <Copy SourceFiles="@(IconFiles)" DestinationFolder="$(WwwRootDir)css\icons\%(RecursiveDir)" SkipUnchangedFiles="true" /> |
| 40 | + |
| 41 | + <ItemGroup> |
| 42 | + <FontFiles Include="$(NodeModulesDir)devextreme-dist\css\fonts\**\*" /> |
| 43 | + </ItemGroup> |
| 44 | + <Copy SourceFiles="@(FontFiles)" DestinationFolder="$(WwwRootDir)css\fonts\%(RecursiveDir)" SkipUnchangedFiles="true" /> |
20 | 45 | </Target> |
21 | 46 |
|
22 | 47 | <ItemGroup> |
|
0 commit comments