Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Can't figure out how to import JavaScript modules #20

@SillyFreak

Description

@SillyFreak

I've added the following code to lib.rs (see here):

#[wasm_bindgen(module = "./helper")]
extern "C" {
    pub fn foo();
}

(plus a call to foo in run()) and tried to figure out where to place helper.js, but everywhere I've tried (project root, js/, crate/, crate/src/, crate/pkg/) doesn't work. I have the feeling the file is ignored entirely; should this be working, and if so, how?

I'm on Linux and using npm run start for my tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions