Hello, first of all let me mention I'm new to Joplin plugin development as well as wasm.
I'm trying to create a plugin that calls into a wasm module created using rust/wasm-pack but keep failing.
You can find a dummy app in following repository: https://github.com/stepnivlk/joplin-wasm-plugin
The code compiled to wasm is simple function returning a string: https://github.com/stepnivlk/joplin-wasm-plugin/blob/2/hello-wasm/src/lib.rs
and works fine imported in create-wasm-app: https://github.com/stepnivlk/joplin-wasm-plugin/blob/1/www/index.js
I can import the js wrapper in freshly generated joplin plugin: https://github.com/stepnivlk/joplin-wasm-plugin/blob/1/plugin/src/index.ts
but npm run dist
gives:
ERROR in ../hello-wasm/pkg/hello_wasm_bg.wasm
WebAssembly module is included in initial chunk.
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
The rearrangement as requested in the error didn't work.
I managed to make the plugin compile by applying following diff: https://github.com/stepnivlk/joplin-wasm-plugin/compare/1...2
but the compiled JS wrapper seems corrupted and the wasm file seems to be missing (by checking the source in dev tools of Joplin).
I'm probably missing something, I tried to search for wasm in Joplin but didn't find much. Is there a way how to create such a plugin?
Thanks!