add wasm
This commit is contained in:
10
wasm/site/index.html
Normal file
10
wasm/site/index.html
Normal 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
4
wasm/site/index.js
Normal 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
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
13
wasm/site/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
9
wasm/site/webpack.config.js
Normal file
9
wasm/site/webpack.config.js
Normal 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"
|
||||
};
|
||||
Reference in New Issue
Block a user