flarelabs-net / vite-environment-providers

1 stars 0 forks source link

Patch module fallback to handle paths nicely #14

Closed dario-piotrowicz closed 5 days ago

dario-piotrowicz commented 1 week ago

resolves #10


In order to facilitate a conversation with the workerd team I thought of, instead of documenting the current behavior vs the behavior we'd prefer (which could introduce potential ambiguities/misunderstandings) to create a "patch" for the module fallback handler.

That's that this new patchModuleFallbackHandler is, it is a wrapper that by itself "fixes"/"adjusts" the workerd behavior for the provided handler function.

The argument handler function is precisely the function I would like to work in workerd out of the box.

With this we can basically point the workerd team to this patchModuleFallbackHandler and get their feedback on it, as it includes all that should be amended in workerd in relation to the awkward paths.

(basically I moved all the workerd tweaking in a single isolated place)