Always fully build Components.Server.csproj (#9421)
* Always fully build Components.Server.csproj * Use pre-built js files instead of building on the fly * Use a sourcemap file for Debug. .gitignore sourcemap files * Install nodejs on CodeCheck agents Fixes https://github.com/aspnet/AspNetCore/issues/9402
This commit is contained in:
parent
2f6b888327
commit
56e2080ef7
|
|
@ -24,7 +24,6 @@ jobs:
|
|||
jobDisplayName: Code check
|
||||
agentOs: Windows
|
||||
installJdk: false
|
||||
installNodeJs: false
|
||||
steps:
|
||||
- powershell: ./eng/scripts/CodeCheck.ps1 -ci
|
||||
displayName: Run eng/scripts/CodeCheck.ps1
|
||||
|
|
|
|||
|
|
@ -130,6 +130,11 @@ try {
|
|||
& $dotnet run -p "$repoRoot/eng/tools/BaselineGenerator/"
|
||||
}
|
||||
|
||||
Write-Host "Re-generating Browser.JS files"
|
||||
Invoke-Block {
|
||||
& $dotnet build "$repoRoot\src\Components\Browser.JS\Microsoft.AspNetCore.Components.Browser.JS.npmproj"
|
||||
}
|
||||
|
||||
Write-Host "Run git diff to check for pending changes"
|
||||
|
||||
# Redirect stderr to stdout because PowerShell does not consistently handle output to stderr
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<Target Name="Restore">
|
||||
<Message Importance="High" Text="Running yarn install on $(MSBuildProjectFullPath)" />
|
||||
<Yarn Command="install $(InstallArgs)" />
|
||||
<Yarn Command="install $(InstallArgs)" StandardOutputImportance="High" StandardErrorImportance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PrepareForBuild">
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
<PropertyGroup>
|
||||
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
||||
<NuspecProperties>
|
||||
configuration=$(Configuration);
|
||||
version=$(PackageVersion);
|
||||
publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir)));
|
||||
componentsversion=$(ComponentsPackageVersion);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@
|
|||
<file src="build\**" target="build" />
|
||||
<file src="targets\**" target="targets" />
|
||||
<file src="$publishdir$netcoreapp3.0\**\*" target="tools/" />
|
||||
<file src="..\..\..\Browser.JS\src\dist\blazor.*.js" target="tools/blazor" />
|
||||
<file src="..\..\..\Browser.JS\dist\$configuration$\blazor.*.js" target="tools/blazor" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<BlazorBuildReferenceFromSource>true</BlazorBuildReferenceFromSource>
|
||||
<BlazorJsPath>$(RepositoryRoot)src\Components\Browser.JS\src\dist\blazor.*.js</BlazorJsPath>
|
||||
<BlazorJsPath>$(RepositoryRoot)src\Components\Browser.JS\dist\$(Configuration)\blazor.*.js</BlazorJsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)targets/All.props" />
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
node_modules/
|
||||
dist/
|
||||
*.js.map
|
||||
|
|
|
|||
|
|
@ -7,28 +7,23 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<WebpackInputs Include="**\*.ts" Exclude="node_modules\**" />
|
||||
<WebPackOutputs Include="src\dist\blazor.webassembly.js" />
|
||||
<WebPackOutputs Include="src\dist\blazor.server.js" />
|
||||
<WebpackInputs Include="src\**\*.ts" />
|
||||
<WebPackOutputs Include="dist\Debug\blazor.webassembly.js" />
|
||||
<WebPackOutputs Include="dist\Release\blazor.webassembly.js" />
|
||||
<WebPackOutputs Include="dist\Debug\blazor.server.js" />
|
||||
<WebPackOutputs Include="dist\Release\blazor.server.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
||||
|
||||
<!--
|
||||
Invoking build[.cmd|.sh] does not restore npm projects by default. This is a performance optimization.
|
||||
However, we want to ensure yarn's restored before a P2P build happens. We'll conservatively yarn install
|
||||
if the node_modules directory is missing.
|
||||
-->
|
||||
<Target Name="FastRestore" DependsOnTargets="Restore" Condition="!Exists('node_modules')" />
|
||||
|
||||
<!-- Override the default 'Build' target from eng/targets/Npm.Common.targets. -->
|
||||
<Target Name="Build"
|
||||
DependsOnTargets="FastRestore"
|
||||
Inputs="@(WebpackInputs)"
|
||||
Outputs="@(WebPackOutputs)">
|
||||
<RemoveDir Directories="dist" />
|
||||
<Yarn Command="run build:debug" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<Yarn Command="run build:production" Condition="'$(Configuration)' != 'Debug'" />
|
||||
|
||||
<Yarn Command="run build:debug" StandardOutputImportance="High" StandardErrorImportance="High" />
|
||||
<Yarn Command="run build:production" StandardOutputImportance="High" StandardErrorImportance="High" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,7 @@ const webpack = require('webpack');
|
|||
|
||||
module.exports = (env, args) => ({
|
||||
resolve: { extensions: ['.ts', '.js'] },
|
||||
devtool: args.mode === 'development' ? 'inline-source-map' : 'none',
|
||||
devtool: args.mode === 'development' ? 'source-map' : 'none',
|
||||
module: {
|
||||
rules: [{ test: /\.ts?$/, loader: 'ts-loader' }]
|
||||
},
|
||||
|
|
@ -11,5 +11,5 @@ module.exports = (env, args) => ({
|
|||
'blazor.webassembly': './Boot.WebAssembly.ts',
|
||||
'blazor.server': './Boot.Server.ts',
|
||||
},
|
||||
output: { path: path.join(__dirname, '/dist'), filename: '[name].js' }
|
||||
output: { path: path.join(__dirname, '/..', '/dist', args.mode == 'development' ? '/Debug' : '/Release'), filename: '[name].js' }
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,6 +12,5 @@
|
|||
<Reference Include="Microsoft.Extensions.Caching.Memory" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
|
||||
<Reference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -9,16 +9,6 @@
|
|||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Producing this package requires building with NodeJS enabled. -->
|
||||
<PropertyGroup Condition="'$(BuildNodeJS)' == 'false'">
|
||||
<IsPackable>false</IsPackable>
|
||||
<GenerateEmbeddedFilesManifest>false</GenerateEmbeddedFilesManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(ComponentsSharedSourceRoot)\src\CacheHeaderSettings.cs" Link="Shared\CacheHeaderSettings.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AspNetCore.Components.Browser" />
|
||||
<Reference Include="Microsoft.Extensions.Logging" />
|
||||
|
|
@ -27,11 +17,6 @@
|
|||
<Reference Include="Microsoft.Extensions.Caching.Memory" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
|
||||
|
||||
<!--
|
||||
Temporary until we move the prerendering APIs into this assembly.
|
||||
-->
|
||||
<Reference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
@ -39,6 +24,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(ComponentsSharedSourceRoot)src\CacheHeaderSettings.cs" Link="Shared\CacheHeaderSettings.cs" />
|
||||
|
||||
<Compile Include="$(RepositoryRoot)src\SignalR\common\Shared\BinaryMessageFormatter.cs" LinkBase="BlazorPack" />
|
||||
<Compile Include="$(RepositoryRoot)src\SignalR\common\Shared\BinaryMessageParser.cs" LinkBase="BlazorPack" />
|
||||
<Compile Include="$(RepositoryRoot)src\SignalR\common\Shared\MemoryBufferWriter.cs" LinkBase="BlazorPack" />
|
||||
|
|
@ -59,13 +46,13 @@
|
|||
<Compile Include="$(MessagePackRoot)SequenceReaderExtensions.cs" LinkBase="BlazorPack\MessagePack" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(BuildNodeJS)' != 'false'">
|
||||
<!-- We need .Browser.JS to build first so we can embed its .js output -->
|
||||
<EmbeddedResource Include="..\..\Browser.JS\src\dist\blazor.server.js" LogicalName="_framework\%(Filename)%(Extension)" />
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Browser.JS\dist\$(Configuration)\blazor.server.js" LogicalName="_framework\%(Filename)%(Extension)" />
|
||||
|
||||
<EmbeddedResource
|
||||
Include="..\..\Browser.JS\dist\$(Configuration)\blazor.server.js.map"
|
||||
LogicalName="_framework\%(Filename)%(Extension)"
|
||||
Condition="Exists('..\..\Browser.JS\dist\$(Configuration)\blazor.server.js.map')" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_EnsureBrowserJS" BeforeTargets="CoreCompile" Condition="'$(BuildNodeJS)' != 'false'">
|
||||
<MSBuild Projects="..\..\Browser.JS\Microsoft.AspNetCore.Components.Browser.JS.npmproj" Targets="Build" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue