-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable optimizeDeps.esbuildOptions.loader #6840
Conversation
Hi @dickeylth, I've put this in the team board to be discussed in the next meeting. Can't promise this would be talked on next though as we already had a lot in the list. Though it may be good to rebase too in the meantime. From a glance, the idea sounds fine to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dickeylth we discussed the PR in today's team meeting and we think it is a good addition.
There is a debug message that should be modified to reflect the used loader:
debug(
`Unable to parse dependency: ${id}. Trying again with a JSX transform.`
)
Once the message is corrected, and conflicts solved we can merge it 👍🏼
enable respect `optimizeDeps.esbuildOptions.loader` option so that the map of js types to loader could be customized, relevant issue: vitejs#3448
@bluwy @patak-dev It's been about 3 weeks, when will this pr be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've cleaned it up a bit, and merged up main. I think we forgot to merge this one in, but this lgtm to merge anytime.
Description
Enable scan respect
optimizeDeps.esbuildOptions.loader
option so that the map of js types to loader could be customized, relevant issue: #3448Additional context
I've read the relevant pr: #1884 and the suggested solution is "use an esbuild plugin to specify your own loaders", which I think it could be discussed because in that way the
import.meta.glob
logic would be missing in my own esbuild plugin. In my situation there are some internal ui library codes which have decorators in.jsx
files and esbuild could only work by specify--loader:.jsx=tsx
, since we haveoptimizeDeps.esbuildOptions
in vite config I think it's acceptable to enable the buildloader
config to be recognized, otherwise maybe we should addloader
into theomit
list to avoid misleading option?What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).