dnt icon indicating copy to clipboard operation
dnt copied to clipboard

Possibility to disable some polyfills

Open MirKml opened this issue 5 months ago • 0 comments

In one of the latest releases, a huge polyfill for import.meta was added. However, the current LTS Node - 22 - supports import.meta fine. It’s clear that DNT has to support older Node versions, but the possibility to disable some polyfills is desired.

I also found this PR https://github.com/denoland/dnt/pull/441 - when script target is latest, no pollyfills are applied, but it seems doesn't work, I set

compilerOptions: {
    lib: ["ESNext"],
    target: "Latest",
  },

and import.meta polyfill is still applied. Source of pollyfill isn't included but code is transformed into globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).dirname. This leads to error in generated code runtime.

MirKml avatar Jul 29 '25 11:07 MirKml