全局安装assemblyscript

npm i -S AssemblyScript/assemblyscript glob


生成编译脚手架
npx asinit .

项目构建
npm run asbuild

示例代码如下:
  export function add(a: i32, b: i32): i32 {
    return a + b;
  }
  
 编译结果:
  AssemblyScript基本使用与项目构建

 

 在webpack中使用可以直接
  import('./untouched.wasm').then(mode=>{
  console.log(mode.intace.add(1,2));
  })

可以直接把上面的编译过程集成进webpack、需要安装assemblyscript-loader、assemblyscript
 具体可见官方文档

相关文章:

  • 2021-08-08
  • 2021-09-15
  • 2021-08-22
  • 2022-01-30
  • 2021-08-04
  • 2021-10-13
  • 2021-04-04
  • 2021-05-21
猜你喜欢
  • 2021-04-01
  • 2022-02-08
  • 2022-01-19
  • 2021-11-08
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
相关资源
相似解决方案