| 1 |
# `raw_module = "blah"` |
| 2 |
|
| 3 |
This attribute performs exactly the same purpose as the [`module` |
| 4 |
attribute](module.html) on JS imports, but it does not attempt to interpret |
| 5 |
paths starting with `./`, `../`, or `/` as JS snippets. For example: |
| 6 |
|
| 7 |
```rust |
| 8 |
#[wasm_bindgen(raw_module = "./some/js/file.js")] |
| 9 |
extern "C" { |
| 10 |
fn the_function(); |
| 11 |
} |
| 12 |
``` |
| 13 |
|
| 14 |
Note that if you use this attribute with a relative or absolute path, it's |
| 15 |
likely up to the final bundler or project to assign meaning to that path. This |
| 16 |
typically means that the JS file or module will be resolved relative to the |
| 17 |
final location of the wasm file itself. That means that `raw_module` is likely |
| 18 |
unsuitable for libraries on crates.io, but may be usable within end-user |
| 19 |
applications. |