flarelabs-net / vite-environment-providers

1 stars 0 forks source link

TODO: try not to use vite's `createIdResolver` #11

Open dario-piotrowicz opened 1 week ago

dario-piotrowicz commented 1 week ago

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?

dario-piotrowicz commented 4 days 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.