Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fix the plugin not working on windows: the problem is that the browser requests the asset with
<UNIT>:/
and so the browser (at least chrome) detects the request as a file requestfile:///<UNIT>:/....
.To solve the problem, we intercept the
/__inspect_api/resolve
request on the middleware and transform it to return this url/__resolve_windows/<UNIT>/....
when the server is running on windows and theid
matches the following pattern/^([A-Z]+):\/(.*)/
, where the<UNIT>
is the first capturing group (maybe we can add also lower casea-z
but I think it is always on upper case and add+
, I don't remember the max number of units windows can mount).The first problem is solved, that is, the browser will not fail when fetching the resolved asset:
Then, we need to restore the original id on server when the id starts with
/__resolve_windows/
for:plugin.transform
,plugin.load
andplugin.resolveId
./__inspect_api
, I don't know if it is necessary to do it on/module
and/clear
, since the client will send the orginal asset name on query request and/list
will return the server names.closes #2