-
-
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: non-blocking esbuild optimization at build time #8280
feat: non-blocking esbuild optimization at build time #8280
Conversation
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Yeah this feels a lot better! I think #7568 looks good. There's test failing, but I was waiting for it to be out-of-draft to give my approval 😬 |
fix: optimizeDeps.include support address the issue brought by @bluwy here #8265 (comment), one of the skipped tests has been reverted and is passing now. I'm going to continue working on this PR and leave #8265 as reference to showcase the implementation using proxies. But I believe that the approach here is more sound moving forward. |
Agreed that we should keep it separate, especially when we have
Since we're not apply plugins in prebundling yet, I think most of the points there are not applicable for now. |
I think the PR is in a good state now to be merged. It would be good to release an alpha including it for people to test, and keep working to fix possible regressions in future PRs. |
Description
Alternative to:
If we merge:
At #4921, Evan proposed:
In this PR, we don't perform any scanning during build. We know what dependencies needs interop without waiting for esbuild optimization, so we can let rollup process all user source code (so we have something better than the scan phase because transforms are applied). When rollup is iddle, we perform the optimization step and resolve the loading of optimized deps.
Right now it is using a simple delay on a transform hook, but we can surely do something more robust. I think rollup gives us a way to wait until it is only waiting.
Edit: to disable the deps optimizer during build you can use
optimizeDeps.disabled: 'build'
.The disabled experimental option has been extended as
optimizeDeps.disabled: boolean | 'dev' | 'build'
What is the purpose of this pull request?