Skip to content

Commit faf49c7

Browse files
committed
Reorganize the import_js example
1 parent 362777f commit faf49c7

File tree

7 files changed

+5
-5
lines changed

7 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ members = [
6666
"examples/fetch",
6767
"examples/guide-supported-types-examples",
6868
"examples/hello_world",
69-
"examples/import_js",
69+
"examples/import_js/crate",
7070
"examples/julia_set",
7171
"examples/paint",
7272
"examples/performance",
File renamed without changes.
File renamed without changes.

examples/import_js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// For more comments about what's going on here, check out the `hello_world`
22
// example
3-
import('./pkg/import_js')
3+
import('./crate/pkg/import_js')
44
.catch(console.error);

examples/import_js/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
template: 'index.html'
1515
}),
1616
new WasmPackPlugin({
17-
crateDirectory: path.resolve(__dirname, ".")
17+
crateDirectory: path.resolve(__dirname, "crate")
1818
}),
1919
// Have this example work in Edge which doesn't ship `TextEncoder` or
2020
// `TextDecoder` at this time.

guide/src/examples/import-js.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ For example if you're working with this JS file:
1313

1414
```js
1515
// defined-in-js.js
16-
{{#include ../../../examples/import_js/defined-in-js.js}}
16+
{{#include ../../../examples/import_js/crate/defined-in-js.js}}
1717
```
1818

1919
you can use it in Rust with:
2020

2121
```rust
22-
{{#include ../../../examples/import_js/src/lib.rs}}
22+
{{#include ../../../examples/import_js/crate/src/lib.rs}}
2323
```
2424

2525
You can also [explore the full list of ways to configure imports][attr]

0 commit comments

Comments
 (0)