Skip to content

esm imports created by rolldown don't remove the node: protocol when needed #276

@SuperchupuDev

Description

@SuperchupuDev

Reproduction link or steps

https://github.com/SuperchupuDev/tsdown-node-protocol-repro/blob/b16fb58

What is expected?

the following import generated by rolldown should have the node protocol removed, like this:

import { createRequire } from "module";

What is actually happening?

it fails to remove the node: protocol

import { createRequire } from "node:module";

Any additional comments?

someone opened a pr on fdir to switch to tsdown, thecodrr/fdir#147, and i suggested to use the removeNodeProtocol option to ensure compatibility with node 12. when testing locally i noticed there was one import that had it

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions