This commit is contained in:
2020-01-30 21:11:12 +08:00
parent 66b3d096db
commit 9e8f93b667
9 changed files with 5600 additions and 0 deletions

10
wasm/site/index.html Normal file
View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>hello-wasm example</title>
</head>
<body>
<script src="./index.js"></script>
</body>
</html>

4
wasm/site/index.js Normal file
View File

@@ -0,0 +1,4 @@
const js = import("./node_modules/hello-wasm/hello_wasm.js");
js.then(js => {
js.greet("WebAssembly");
});

5521
wasm/site/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

13
wasm/site/package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"scripts": {
"serve": "webpack-dev-server"
},
"dependencies": {
"hello-wasm": "../pkg"
},
"devDependencies": {
"webpack": "^4.25.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
}
}

View File

@@ -0,0 +1,9 @@
const path = require('path');
module.exports = {
entry: "./index.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "index.js",
},
mode: "development"
};