mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-15 17:50:51 +00:00
Change module import
This commit is contained in:
parent
a25925346a
commit
53c65039b9
@ -3,10 +3,8 @@
|
||||
# For more comments about what's going on here, see the `hello_world` example
|
||||
|
||||
set -ex
|
||||
cd "$(dirname $0)"
|
||||
|
||||
cargo build --target wasm32-unknown-unknown
|
||||
|
||||
cargo run --manifest-path ../../crates/cli/Cargo.toml \
|
||||
--bin wasm-bindgen -- \
|
||||
../../target/wasm32-unknown-unknown/debug/todomvc.wasm --out-dir .
|
||||
|
@ -37,6 +37,5 @@
|
||||
<p>Written by <a href="http://twitter.com/KingstonTime/">Jonathan Kingston</a></p>
|
||||
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
|
||||
</footer>
|
||||
<script src='./index.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,3 +1,4 @@
|
||||
import('./todomvc').then(todomvc => {
|
||||
todomvc.run();
|
||||
});
|
||||
// For more comments about what's going on here, check out the `hello_world`
|
||||
// example
|
||||
import('./todomvc')
|
||||
.catch(console.error);
|
||||
|
@ -64,7 +64,9 @@ fn app(name: &str) {
|
||||
|
||||
/// Entry point into the program from JavaScript
|
||||
#[wasm_bindgen(start)]
|
||||
pub fn run() {
|
||||
pub fn run() -> Result<(), JsValue> {
|
||||
console_error_panic_hook::set_once();
|
||||
app("todos-wasmbindgen");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
entry: './index.js',
|
||||
|
Loading…
x
Reference in New Issue
Block a user