Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from yamafaktory/webpack-alpha-1
Browse files Browse the repository at this point in the history
Bump up webpack alpha version 🚀.
  • Loading branch information
yamafaktory authored Dec 19, 2017
2 parents 3e5b60b + 3cb053e commit 8658308
Show file tree
Hide file tree
Showing 4 changed files with 1,650 additions and 174 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
"rust-native-wasm-loader": "0.1.4",
"snazzy": "7.0.0",
"standard": "10.0.3",
"webpack": "v4.0.0-alpha.0",
"webpack-dev-server": "3.0.0-alpha5"
"webpack": "v4.0.0-alpha.1",
"webpack-cli": "1.5.2",
"webpack-dev-server": "3.0.0-alpha6"
},
"scripts": {
"build": "webpack",
Expand Down
15 changes: 0 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
#![feature(lang_items)]
#![no_std]

#[no_mangle]
pub fn add_one(number: i32) -> i32 {
number + 1
}

// Needed for no_std!
#[lang = "panic_fmt"]
#[no_mangle]
pub extern "C" fn rust_begin_panic(
_msg: core::fmt::Arguments,
_file: &'static str,
_line: u32,
_column: u32,
) -> ! {
loop {}
}
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import('../src/lib.rs').then(wasm => {
console.log(wasm.default.add_one(22))
console.log(wasm.add_one(22))
})
Loading

0 comments on commit 8658308

Please sign in to comment.