Open surma opened 3 years ago
What about using denoify to build deno-compatible code? Then we can commit the built files by GitHub Actions
workaround:
Add
{
"imports": {
"https://unpkg.com/comlink@4.3.1/dist/esm/protocol": "https://unpkg.com/comlink@4.3.1/dist/esm/protocol.d.ts"
}
}
to your importmap and import comlink like this:
// @deno-types="https://unpkg.com/comlink@4.3.1/dist/esm/comlink.d.ts"
import {/*...*/} "https://unpkg.com/comlink@4.3.1/dist/esm/comlink.mjs";
This import can be simplified with a extra file
// @deno-types="https://unpkg.com/comlink@4.3.1/dist/esm/comlink.d.ts"
export * from "https://unpkg.com/comlink@4.3.1/dist/esm/comlink.mjs";
in ./deps/comlink.ts
and also add
{
"comlink": "./deps/comlink.ts"
}
to the importmap.
Currently, you can use Comlink in Deno through one of the npm CDNs (unpkg, skypack etc). But it’d be nice to be able to import the source from GitHub directly. This currently doesn’t work as TypeScript enforces either no file extensions in imports or
.js
extension, while Deno requires the actual file path (ending in.ts
).