This commit is contained in:
2025-04-19 15:19:48 +08:00
parent b9386de0b1
commit c44d5925a4
7 changed files with 72 additions and 4 deletions

33
deno-wasm/deno.json Normal file
View File

@@ -0,0 +1,33 @@
{
"compilerOptions": {
"lib": [
"deno.window"
]
},
"tasks": {
"start": "deno run --allow-net deno-server/server.ts",
"build:wasm": "deno compile --target wasm -- --outfile dist/index.wasm src/index.ts"
},
"imports": {
"http/": "https://deno.land/std@0.220.1/http/"
},
"lint": {
"include": [
"./src/**/*.ts",
"index.ts"
],
"exclude": [
"./types"
],
"rules": {
"tags": [
"recommended"
],
"include": [],
"exclude": [
"require-await",
"no-explicit-any"
]
}
}
}

5
deno-wasm/src/index.ts Normal file
View File

@@ -0,0 +1,5 @@
// export const add = (a: number, b: number) => a + b;
import { add } from "../../dist/index.wasm";
console.log(add(1, 2));