fix(esbuild): Don't use namespace for esbuild proxy resolving#311
Merged
Conversation
Potentially fixes #310
mydea
reviewed
Jun 12, 2023
| esbuild: { | ||
| setup({ onLoad, onResolve }) { | ||
| onResolve({ filter: /.*/ }, (args) => { | ||
| onResolve({ filter: /.*/, namespace: "file" }, (args) => { |
Member
There was a problem hiding this comment.
do we need this? We are just hard-coding file below 😅
Author
There was a problem hiding this comment.
You are right, the namespace filter here is very likely unnecessary since we only want to resolve entrypoints which should only have the "file" namespace anyways (since "file" is the default).
The "passthrough" namespace below is then also unnecessary --> removed in 5c24b30
mydea
reviewed
Jun 12, 2023
| }); | ||
|
|
||
| onLoad({ filter: /.*/, namespace: proxyNamespace }, (args) => { | ||
| onLoad({ filter: /.*/, namespace: "file" }, (args) => { |
Member
There was a problem hiding this comment.
also here, do we need namespace here?
Author
There was a problem hiding this comment.
Yeah this namespace is also unnecessary. I think I defined it because I wanted to be conservative over what files we resolve/load, but thinking about it again, it seems unnecesary.
Thanks for questioning this!
mydea
approved these changes
Jun 12, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Potentially fixes #310
Problem was setting a custom namespace to detect that we were in fact in our proxy module. This cascaded down into user code and caused compilation errors when they were using other resolver plugins (eg. to resolve css assets).
We now instead use plugin data to detect the same thing.