|
@@ -1,24 +1,59 @@
|
|
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
|
|
|
|
- <PropertyGroup>
|
|
|
- <TargetFramework>net8.0</TargetFramework>
|
|
|
- <Nullable>enable</Nullable>
|
|
|
- <ImplicitUsings>enable</ImplicitUsings>
|
|
|
- <SpaRoot>..\IES.ExamWebview</SpaRoot>
|
|
|
- <SpaProxyLaunchCommand>npm run dev</SpaProxyLaunchCommand>
|
|
|
- <SpaProxyServerUrl>https://localhost:5173</SpaProxyServerUrl>
|
|
|
- </PropertyGroup>
|
|
|
+ <PropertyGroup>
|
|
|
+ <TargetFramework>net6.0</TargetFramework>
|
|
|
+ <Nullable>enable</Nullable>
|
|
|
+ <ImplicitUsings>enable</ImplicitUsings>
|
|
|
+ </PropertyGroup>
|
|
|
+ <PropertyGroup>
|
|
|
+ <SpaRoot>ClientApp\</SpaRoot>
|
|
|
+ <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
|
|
|
+ </PropertyGroup>
|
|
|
|
|
|
- <ItemGroup>
|
|
|
- <ProjectReference Include="..\IES.ExamWebview\IES.ExamWebview.esproj">
|
|
|
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
|
|
- </ProjectReference>
|
|
|
- </ItemGroup>
|
|
|
+ <ItemGroup>
|
|
|
+ <!-- Don't publish the SPA source files, but do show them in the project files list -->
|
|
|
+ <Content Remove="$(SpaRoot)**" />
|
|
|
+ <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
|
|
+ </ItemGroup>
|
|
|
|
|
|
- <ItemGroup>
|
|
|
- <PackageReference Include="Microsoft.AspNetCore.SpaProxy">
|
|
|
- <Version>8.*-*</Version>
|
|
|
- </PackageReference>
|
|
|
- </ItemGroup>
|
|
|
+ <ItemGroup>
|
|
|
+ <Folder Include="ClientApp\src\models\" />
|
|
|
+ <Folder Include="wwwroot\" />
|
|
|
+ </ItemGroup>
|
|
|
|
|
|
+ <ItemGroup>
|
|
|
+ <PackageReference Include="VueCliMiddleware" Version="6.0.0" />
|
|
|
+ </ItemGroup>
|
|
|
+ <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build">
|
|
|
+ <!-- Build Target: Ensure Node.js is installed -->
|
|
|
+ <Exec Command="node --version" ContinueOnError="true">
|
|
|
+ <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
|
|
|
+ </Exec>
|
|
|
+ <Exec Command="npm --version" ContinueOnError="true">
|
|
|
+ <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
|
|
|
+ </Exec>
|
|
|
+ <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js and npm are 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." />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="EnsureNodeModulesInstalled" BeforeTargets="Build" Inputs="package.json" Outputs="packages-lock.json" Condition="!Exists('$(SpaRoot)node_modules')">
|
|
|
+ <!-- Build Target: Restore NPM packages using npm -->
|
|
|
+ <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
|
|
|
+ <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
|
|
|
+ <!-- Build Target: Run webpack dist build -->
|
|
|
+ <Message Importance="high" Text="Running npm build..." />
|
|
|
+ <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" />
|
|
|
+
|
|
|
+ <!-- Include the newly-built files in the publish output -->
|
|
|
+ <ItemGroup>
|
|
|
+ <DistFiles Include="$(SpaRoot)dist\**" />
|
|
|
+ <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
|
|
|
+ <RelativePath>%(DistFiles.Identity)</RelativePath>
|
|
|
+ <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
|
+ <ExcludeFromSingleFile>True</ExcludeFromSingleFile>
|
|
|
+ </ResolvedFileToPublish>
|
|
|
+ </ItemGroup>
|
|
|
+ </Target>
|
|
|
</Project>
|