Replies: 1 comment
-
There is another way of incorporating Webpack by using Webpack instead of Trunk: #2333. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to include Milkdown as a component into my leptos web app. Milkdown is a Javascript library available on NPM. I need to run a small JavaScript file initializing that library, something similar to
Cargo-leptos offers a way to bundle JavaScript files via
#[wasm_bindgen(module = "/file/path.js")
, so I tried that. But unfortunately it seems wasm-bindgen doesn't supportimport
statements in those files.What is the best way to get this to work? Ideally, I'm looking for a way for leptos or cargo-leptos to run a bundler for me, run tree-shaking, and then deploy the final artifact. But if that's not possible, I'm also ok with other solutions.
The only way I could think of at the moment is to set up my own webpack config, run webpack from a
build.rs
file, and move the final result somewhere cargo-leptos can find it. But this seems complicated and I feel like "adding npm dependencies" seems like a feature that would be useful to many leptos users. So I was wondering whether leptos already has or is planning to add a better way to do this.Beta Was this translation helpful? Give feedback.
All reactions