Skip to content

Support for tracing files for Edge runtime #442

@ckohen

Description

@ckohen

I know this package is called node file trace, but I believe it's utility extends far beyond just node. I would venture to say that the name indicates that it's a file tracer that was built to run in node.

I have a vercel project (monorepo update splitter) that builds it's own custom output. The middleware in this project obviously runs on the edge (and I've attempted to run some of the other functions on the edge in the past).

Edge functions do (now) support importing from node_modules files included in their func folder, and thus no longer need to be bundled. This is nearly possible with just conditions, however a lot of packages don't have export conditions, and instead use the web / browser string variants as it has been supported for much longer. I have built a simple patch for the runner api of this package that allows me to specify whether an entrypoint is expected to run in a web-based runtime, and it then adjusts what field of package.json it looks for a "main" entrypoint from. This has proved quite useful, and I think this package could benefit from having it natively.

Is this something that would be acceptable to add?

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