Skip to content

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Oct 19, 2025

Description

This PR adds import.meta.resolve support to bundle config loader, applying the same logic from #20260.

This PR only adds support for ESM configs (config files ending with .mjs / .mts or has type: module in the closest package.json. Supporting this in CJS files requires a bit more code as import.meta.resolve is not available in CJS files.

fixes #20326

@sheremet-va
Copy link
Member

sheremet-va commented Oct 19, 2025

Just a note, but in Vitest we noticed that module.register takes a long time and it would not be good for us to use the built-in import.meta.resolve support for tests, but I wonder if you could also support module.registerHooks which is faster?

@sapphi-red sapphi-red added this to the 7.2 milestone Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vite hijacks import.meta.resolve resulting in broken configuration files

2 participants