vitest-dev / vitest-dev/vitest

New pool "node-loader"

Open
#3,849 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

Clear and concise description of the problem

Node.js supports experimental loaders to transform code and resolve import paths before executing code.

We currently support deps.registerNodeLoader option, but it only transforms imports inside node_modules packages, and it doesn't work in > Node.js 20 because of an API change.

Supporting loaders makes it easier to test 100% compatible Node.js applications (we don't need to reimplement CJS/ESM for https://github.com/vitest-dev/vitest/pull/2854).

Suggested solution

Support Node.js loaders

Alternative

No response

Additional context

No response

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing deps.registerNodeLoader entry point and read the linked Node.js experimental loaders documentation. Trace its current handling of imports inside node_modules and its behavior on Node.js versions above 20; done means supported loaders can transform code and resolve import paths for compatible applications.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.