8000 GitHub - BenLocal/wx-wasm-pack: wasm-pack for Wechat
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BenLocal/wx-wasm-pack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wx-wasm-pack

wasm-pack for Wechat

Install

cargo install --git https://github.com/BenLocal/wx-wasm-pack

Usage

  1. Create a new project
wx-wasm-pack new demo
  1. Build your WebAssembly package
cd demo
wx-wasm-pack build -t web --no-typescript --release
  1. Integrate with WeChat Mini Program

    Copy the generated files to your WeChat Mini Program project:

  • ./pkg/my-project_bg.wasm: WebAssembly binary
  • ./pkg/my-project.js: JavaScript bindings 4. usage
  1. Use in WeChat Mini Program
// index.js
import initSync, {greet} from "demo"

...

onLoad() {
    // Initialize WebAssembly module
    initSync("/pages/index/demo_bg.wasm")

    // Call exported functions
    greet() // Hello, demo!
},

About

wasm-pack for Wechat

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0