mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-25 06:02:13 +00:00
Reorganize the import_js example
This commit is contained in:
parent
362777fc75
commit
faf49c7d56
@ -66,7 +66,7 @@ members = [
|
||||
"examples/fetch",
|
||||
"examples/guide-supported-types-examples",
|
||||
"examples/hello_world",
|
||||
"examples/import_js",
|
||||
"examples/import_js/crate",
|
||||
"examples/julia_set",
|
||||
"examples/paint",
|
||||
"examples/performance",
|
||||
|
@ -1,4 +1,4 @@
|
||||
// For more comments about what's going on here, check out the `hello_world`
|
||||
// example
|
||||
import('./pkg/import_js')
|
||||
import('./crate/pkg/import_js')
|
||||
.catch(console.error);
|
||||
|
@ -14,7 +14,7 @@ module.exports = {
|
||||
template: 'index.html'
|
||||
}),
|
||||
new WasmPackPlugin({
|
||||
crateDirectory: path.resolve(__dirname, ".")
|
||||
crateDirectory: path.resolve(__dirname, "crate")
|
||||
}),
|
||||
// Have this example work in Edge which doesn't ship `TextEncoder` or
|
||||
// `TextDecoder` at this time.
|
||||
|
@ -13,13 +13,13 @@ For example if you're working with this JS file:
|
||||
|
||||
```js
|
||||
// defined-in-js.js
|
||||
{{#include ../../../examples/import_js/defined-in-js.js}}
|
||||
{{#include ../../../examples/import_js/crate/defined-in-js.js}}
|
||||
```
|
||||
|
||||
you can use it in Rust with:
|
||||
|
||||
```rust
|
||||
{{#include ../../../examples/import_js/src/lib.rs}}
|
||||
{{#include ../../../examples/import_js/crate/src/lib.rs}}
|
||||
```
|
||||
|
||||
You can also [explore the full list of ways to configure imports][attr]
|
||||
|
Loading…
x
Reference in New Issue
Block a user