Skip to content
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

Provide a way to add dependencies to the generated package.json #1470

Open
j2ghz opened this issue Feb 3, 2025 · 0 comments
Open

Provide a way to add dependencies to the generated package.json #1470

j2ghz opened this issue Feb 3, 2025 · 0 comments

Comments

@j2ghz
Copy link

j2ghz commented Feb 3, 2025

💡 Feature description

There should be some way of specifying a list of dependencies that should be included when wasm-pack generates package.json.

💻 Basic example

The public interface of my wasm crate references HidDevice, which is only defined in @types/w3c-web-hid. That means the users of my crate will only see unresolved references (Cannot find name 'HIDDevice'.ts(2304)), unless they install the types themselves. The best practice is to include @types/* dependencies, if they appear in the public interface, but there's no easy way to do that with wasm-pack.
A workarounds is to do text or json manipulation after each wasm-pack build, but that is not great dx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant