Open dario-piotrowicz opened 1 week ago
I'm kind of rethinking this... does it make sense for us to try to implement our own solution/reuse an existing third party one?
Ideally we, as any other environment author, would need to have the same exact module resolution for both dev and production. Vite already provides its own solution for the production side of things so reusing the same strategy, with the same exact options and behaviors for dev does make most sense.
Any third party solution would potentially try to mimic as close as possible the prod behavior in dev, which could be challenging and create a good amount of code that unnecessary re-invents the wheel and can potentially get out of sync with Vite's prod (built-in) behavior.
Currently we're using
createIdResolver
from vite to create module resolvers that we use in the module fallback service callback.We should explore if we could instead use a separate third party solution (like
import-meta-resolve
,enhanced-resolve
,resolve
, etc...).Why would that be beneficial?
createIdResolver
utility especially for us, but this is not a utility that they would like to have to expose and maintain (discussion)vitest-pool-workers
whilst it still needs to usevite@5
(PS: this would be pretty valuable in the short/middle term, not at all in the long term asvitest-pool-workers
should ideally just reuse our vite environment solution under the hood)