无法在 shadow-cljs 项目中导入本地 wasm npm 包

unable to import local wasm npm package in shadow-cljs project

我正在尝试在我的 shadow-cljs 项目中导入 wasm 包。它捆绑在 npm 包中,但我不断收到此错误:

The required JS dependency "canvas" is not available, it was required by "canvas/core.cljs".

这是我的项目结构:

. <- root of the rust crate
├── canvas
│   ├── env
│   ├── node_modules
│   │   ├── ...
│   │   ├── canvas -> ../../pkg <- my local package
│   │   └── ...
│   ├── resources
│   ├── src
│   └── target
├── pkg <- my local package
├── src
├── target
└── tests

这是我的 package.json(来自 clojurescript 项目):

{
  "devDependencies": {
    "shadow-cljs": "^2.8.83"
  },
  "dependencies": {
    "canvas": "file:../pkg",
    "create-react-class": "^15.6.3",
    "react": "^16.4.0",
    "react-dom": "^16.4.0"
  }
}

我 运行 npm install 并将 canvas 模块添加到我的项目中(在 core.cljs 中):

(ns canvas.core
  (:require
    ...
    ["canvas" :as canvas]))

这里好像有什么问题??

Shadow-cljs 不支持 WebAssembly "bundling"。