-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support for WebAssembly (wasm) modules #6
Comments
@stefan2718 I'd love to add support for WASM modules in bundlephobia.
I haven't had a chance to look too deeply into WASM, excuse my ignorance here. If you need a starting point or help navigating code, let me know. |
To use my package as an example, the entrypoint for it is a javascript file (index.js) that imports my wasm module/file and wraps some of the functionality, for example: import * as clusterer from 'path/clusterer.wasm';
clusterer.callWasmMethod(); So a simple way to include the size would be to just get the filesize of any imported It doesn't seem reasonable to support non-compiled wasm, as wasm can be compiled from many vastly different languages. Since you're using webpack here (and that's what's causing the error in my initial post), the fix will likely be modifying the webpack config to handle I can look into this and make a PR. Hopefully it's as simple as changing the webpack config, but it might not be. |
I'm working on a package that uses WebAssembly, here: https://www.npmjs.com/package/wasm-marker-clusterer
Currently,
.wasm
files need to be loaded asynchronously, making it difficult to package them in the standard way that webpack would.This is the build error message that comes up when I try to analyze my package:
I think Wasm modules on NPM will be more and more popular as the technology spreads, and it would be awesome to be able to analyze them with this tool.
If you think this is worthwhile, I'd be interested in putting a PR together.
The text was updated successfully, but these errors were encountered: