Last active
July 14, 2017 22:09
-
-
Save TheLarkInn/def97889b9dacd3f79dc124fad8f3a30 to your computer and use it in GitHub Desktop.
Example of using webpack and .wat as a module type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import("./abc.js").then(abc => abc.doIt()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { add } from "./addition.wat"; | |
export function doIt() { | |
console.log(add(1, 2)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(func | |
(export "add") | |
(param i32 i32) | |
(result i32) | |
(i32.add (get_local 0) (get_local 1)) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment