-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Copydotnet.d.ts to wwwroot on build/publish.
#120097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Its also worth pointing that
Line 279 in 7ab1ed3
Which is an output from the runtime/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs Line 93 in 7ab1ed3
runtime/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs Line 74 in 7ab1ed3
|
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs
Outdated
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs
Outdated
Show resolved
Hide resolved
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs
Outdated
Show resolved
Hide resolved
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs
Outdated
Show resolved
Hide resolved
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmPublishAssets.cs
Outdated
Show resolved
Hide resolved
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmPublishAssets.cs
Outdated
Show resolved
Hide resolved
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/MSBuildOptions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an opt-in MSBuild property to copy the generated dotnet.d.ts TypeScript definition file into a WebAssembly project's wwwroot during build, addressing issue #77174.
- Introduces WasmEmitTypeScriptDefinitions property (default false) in relevant .targets.
- Adds MSBuild target _EnsureDotnetTypeScriptDefinitions to perform the conditional copy.
- Adds a test validating the file copy on build (Debug/Release).
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/mono/wasm/build/WasmApp.Common.targets | Documents and defines the new WasmEmitTypeScriptDefinitions property. |
| src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets | Adds property default again and new target to copy dotnet.d.ts into wwwroot. |
| src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs | Adds test ensuring dotnet.d.ts is copied on build when the property is enabled. |
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
...nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Outdated
Show resolved
Hide resolved
|
WBT fail, even though manual run of |
|
@maraf, this one needs more work. While it works when used "manually", WBT fail. I will investigate it when I get time |
WasmEmitTypeScriptDefinitionsMSBuild property (defaultfalse) so projects can request the generateddotnet.d.tstypings._EnsureDotnetTypeScriptDefinitionstarget copiesdotnet.d.tsfrom the runtime pack into the project’swwwrooton build or publish when that property is enabled.TypeScriptDefinitionsCopiedToWwwrootOnBuild) to cover Debug/Release and verify the file is produced only when requested.Fixes #77174.