mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-28 07:51:07 +00:00
This commit migrates all our examples to using `wasm-pack build` to compile their code and run `wasm-bindgen`. This should make it a bit easier to understand the examples as there's less to follow during the build step. Webpack projects are all using `@wasm-tool/wasm-pack-plugin` as well so the build step is simple `npm run serve`. Other examples which retain `build.sh` are just using `wasm-pack build` now
9 lines
290 B
JavaScript
9 lines
290 B
JavaScript
// Note that a dynamic `import` statement here is required due to
|
|
// webpack/webpack#6615, but in theory `import { greet } from './pkg/hello_world';`
|
|
// will work here one day as well!
|
|
const rust = import('./pkg/hello_world');
|
|
|
|
rust
|
|
.then(m => m.greet('World!'))
|
|
.catch(console.error);
|