... <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <Nullable>enable</Nullable> <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion> <IsPackable>false</IsPackable> <SpaRoot>ClientApp\</SpaRoot> <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> <SpaProxyServerUrl>https://localhost:44434</SpaProxyServerUrl> <SpaProxyLaunchCommand>npm run dev</SpaProxyLaunchCommand> <RootNamespace>test_dotnet_vue_vite</RootNamespace> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> ... <TargetName="PublishRunWebpack"AfterTargets="ComputeFilesToPublish"> <!-- As part of publishing, ensure the JS resources are freshly built in production mode --> <ExecWorkingDirectory="$(SpaRoot)"Command="npm install" /> <ExecWorkingDirectory="$(SpaRoot)"Command="npm run build" />
<!-- Include the newly-built files in the publish output --> <ItemGroup> <DistFilesInclude="$(SpaRoot)dist\**" /> <ResolvedFileToPublishInclude="@(DistFiles->'%(FullPath)')"Exclude="@(ResolvedFileToPublish)"> <RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <ExcludeFromSingleFile>true</ExcludeFromSingleFile> </ResolvedFileToPublish> </ItemGroup> </Target>