Skip to content

Possibility to disable some polyfills #471

@MirKml

Description

@MirKml

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 #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions