How to control order of imports in generated JS #3868
Unanswered
jkelleyrtp
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think they're sorted by the path you're importing from (the final one, e.g. How come they have to be in two separate snippets in the first place? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I have a bit of a strange setup.
I'm linking in a module with the module syntax:
And then I have an inline snippet down below:
#[wasm_bindgen(module = r#"class Interpreter extends WebInterpreter {}"#)]
However, when I go to load the page, the generated glue orders the inline snippet above the module, breaking the extends relationship.
Notice how JSChannel from inline0.js is being imported before setAttributeInner in src/js/web.js. And yet in my Rust code they're ordered properly. Is there just no way of getting the order right?
Beta Was this translation helpful? Give feedback.
All reactions