Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapping for denoland/dnt #5

Closed
UrielCh opened this issue Jul 16, 2022 · 1 comment
Closed

mapping for denoland/dnt #5

UrielCh opened this issue Jul 16, 2022 · 1 comment

Comments

@UrielCh
Copy link

UrielCh commented Jul 16, 2022

Hi, I'm trying to convert my first NodeJS project to deno.

EvenEmiter is a very common NodeJS feature, and I do not know how to convert event usage to NodeJS code with dnt.

Do you know how to do that?

dnt issue

@UrielCh
Copy link
Author

UrielCh commented Jul 18, 2022

issue solved
with the dnt config:

await build({
    entryPoints: ["./mod.ts"],
    outDir: "./npm",
    shims: {
      deno: true,
      webSocket: true,
      undici: true,
      custom: [
        {
          package: {
            name: "stream/web",
          },
          globalNames: ["ReadableStream", "TransformStream"],
        },
        {
          globalNames: [ {name: "MessageEvent", typeOnly: true} ],
          package: {
            name: "ws",
          },
        }
      ],
    },
    compilerOptions: {
      lib: [ "dom", "esnext" ],
    },
...

@UrielCh UrielCh closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant