Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pool "node-loader" #3849

Open
4 tasks done
sheremet-va opened this issue Jul 31, 2023 · 1 comment
Open
4 tasks done

New pool "node-loader" #3849

sheremet-va opened this issue Jul 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sheremet-va
Copy link
Member

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

Suggested solution

Support Node.js loaders

Alternative

No response

Additional context

No response

Validations

@sheremet-va sheremet-va added the enhancement New feature or request label Jul 31, 2023
@segevfiner
Copy link
Contributor

Better yet, is that using a loader, like Jest does in CJS mode with a require hook. Is that Vite can selectively decide to transform or not deep nested imports. So that problem packages imported deep down in the stack that otherwise work correctly when fully bundled can also work in Vitest without requiring to manually add to deps.inline the entire chain of package leading to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants