dotnet / dotnet/AspNetCore.Docs

Not enough information about how to include custom JS files in WASM library projects

Open
#35,882 5 comments 0 reactions 1 assignee Claimed by @wadepickett View on GitHub
aspnet-core/svc client-side/subsvc Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

### Description

It is unclear how one should configure a WebAssembly library project that uses JS Interop to include its own JS files for the consuming application.

For example, I want to make a NuGet package that will be consumed by a WebAssembly (non-Blazor) application, and I need to perform some JS interop on my library, which requires some custom JavaScript files. How can I make these JavaScript files available to the consuming application? I've been digging through the docs, but can't find enough info about it.

I suggest a dedicated section or page on the docs about JS Interop for WASM libraries, with a few project configuration examples if possible.

The present way of performing JS Interop in .NET WebAssembly is somewhat tricky as it is, so the docs need to be as clear as possible to compensate the complexity. Although the docs currently have good examples for a WebAssembly application, they still seem to lack important details for library projects.

### Page URL

https://learn.microsoft.com/en-us/aspnet/core/client-side/dotnet-interop?view=aspnetcore-9.0&source=recommendations

### Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/client-side/dotnet-interop.md

### Document ID

efff6954-a035-d1da-5975-af04ff7c05ed

### Platform Id

ffc7862e-4b77-0c66-5e72-c7ee7e78047b

### Article author

@pavelsavara

### Metadata

* ID: efff6954-a035-d1da-5975-af04ff7c05ed* PlatformId: ffc7862e-4b77-0c66-5e72-c7ee7e78047b * Service: **aspnet-core*** Sub-service: **client-side**

[Related Issues](https://github.com/dotnet/AspNetCore.Docs/issues?q=is%3Aissue+is%3Aopen+efff6954-a035-d1da-5975-af04ff7c05ed)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.