fix(plugin-vite): correct module resolution when Vite optimizeDeps is enabled (#3895) - #3896
Open
mryall-mawson wants to merge 3 commits into
Open
fix(plugin-vite): correct module resolution when Vite optimizeDeps is enabled (#3895)#3896mryall-mawson wants to merge 3 commits into
mryall-mawson wants to merge 3 commits into
Conversation
mryall-mawson
force-pushed
the
fix/3895-vite-loader
branch
from
July 30, 2026 11:21
9d2def1 to
fe855b5
Compare
optimizeDeps is enabled (freshframework#3895)
optimizeDeps is enabled (freshframework#3895)
Author
|
I made a couple more fixes in this PR to get Vite’s It is now tested and working for me, and I've released a fork here which we will use until this fix is released: https://jsr.io/@mawson/fresh-plugin-vite We saw a reduction in our functional test execution time from 3.5 min to 2.5 mins against a dev server with optimizeDeps enabled for some large and deep dependency trees. Edit: the specific error I saw was: |
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.
Enabling
optimizeDepsin Vite config causes the Fresh dev server to fail with file-not-found errors. In this mode, modules URLs include a query string which is not stripped before being passed to Deno's loader, which interprets them as filenames.See #3895 for the full bug description and reproduction.
This PR provides a simple test case using an existing fixture, and the fix in
plugin-viteto strip the query strings before loading.Note there are some existing test failures on
mainwhich this PR does not attempt to fix.