-
Notifications
You must be signed in to change notification settings - Fork 79
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
How to integrate rust wasm into angular 7 project? #47
Comments
Does angular use its own bundler or something? I'm not sure what is different about it compared to normal JS applications. You can always use the https://rustwasm.github.io/docs/wasm-bindgen/examples/without-a-bundler.html |
@fitzgen Thank you, I have solved it by following your advice. |
This is why it does not work with Angular out of the box: Altough I have no idea how to add this extension to the |
Got it to work in Angular 8 (without resorting to One slight annoyance is that just importing the wasm-bindgen-generated module triggers a "WebAssembly module is included in initial chunk" error. I guess that's webpack/webpack#6615. Using import() to import the wasm-bindgen module (as suggested by the error message) does work. And I suspect if my import was in a lazily-loaded Angular module that'd also work around it, but I'm barely past "Hello World" in Angular... don't want to try breaking my app into modules before I've actually gotten it to work :) (It also warns about the circular dependency between the wasm module and the generated js module, I think that's the same thing described on rustwasm/wasm-bindgen#32 and I'll just have to ignore it.) |
angular/angular-cli#14987 was opened a few days ago for getting that extension added in Angular. |
That's a trick I wouldn't have thought of, thanks! |
Summary
How to integrate rust wasm into angular 7 project?
Additional Details
Angular 7 use webpack for packing, but it cannot recognize *.wasm file, I have tried to integrate rust wasm into angular 7 for a few days, but I still can't solve it, Could you provide an angular example project with call method of rust wasm?
The text was updated successfully, but these errors were encountered: