Uh oh!
There was an error while loading. Please reload this page.
Copydotnet.d.ts to wwwroot on build/publish. - #120097
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
JakeYallop
commented
Sep 25, 2025
Its also worth pointing that
Which is an output from the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ilonatommy
commented
Oct 13, 2025
WBT fail, even though manual run of |
ilonatommy
commented
Oct 27, 2025
@maraf, this one needs more work. While it works when used "manually", WBT fail. I will investigate it when I get time |
Uh oh!
There was an error while loading. Please reload this page.
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.