Closed microshine closed 3 months ago
@dchest Could you move forward this PR? I'd like to use this stablelib not on Node.js but on web browsers and Deno.
Thanks, I'm working on supporting es modules, but without rollup as it's super slow for me. Question: how would browser resolve dependencies? For example, the chacha package has these imports:
import { writeUint32LE } from "@stablelib/binary";
import { wipe } from "@stablelib/wipe";
What do you need to do to use this chacha.mjs
from <script type="module">
?
Also, we need to detect the system random number generator (Node or browser) at runtime, and we can't use asynchronous imports for Node's crypto in ES module.
Maybe ESBuild instead of rollup? It's hella fast compared to webpack / rollup / etc.
I haven't used SWC but it might be a good option too.
It makes possible to use modules for both types of nodejs modules -
commonjs
ormodule
.and use modules using https://unpkg.com/ service