fix(build): fix resolution algorithm when build.ssr is true#9989
fix(build): fix resolution algorithm when build.ssr is true#9989patak-dev merged 5 commits intovitejs:mainfrom
build.ssr is true#9989Conversation
build.ssr is truebuild.ssr is true
patak-dev
left a comment
There was a problem hiding this comment.
LGTM. Thanks a lot for the fix!
|
One improvement we could do before merging is to move the new tests to an existing playground. Our e2e CI is taking quite a bit of time already so we are trying to keep the number of playgrounds at check. Instead of importing real packages in the |
|
Hi @patak-dev, thanks for looking at this! I had gone that route initially and created packages in Log output from that branchSo, I've removed the real packages ( |
patak-dev
left a comment
There was a problem hiding this comment.
Makes sense. Thanks a lot for reworking the test cases and for the clear exposition of your steps on this PR.
|
@patak-dev @bluwy can we please get this merged? |
|
@mrm007 would you address @ydcjeff comments first? Thanks! |
bluwy
left a comment
There was a problem hiding this comment.
Didn't realized a requested review from me. This looks good 👍 I second @ydcjeff's changes too before merging.
|
@patak-dev Do we have any timeline on when this would be released? It doesn't look like it made it into v3.1.4, but we're very keen to be able to move forward with our project. |
|
@benjervis would you send a PR cherry-picking this one to the |
|
@patak-dev I've opened #10354 |
Description
This PR fixes the resolution algorithm when
build.ssristruei.e. whentryNodeResolveis called withssr: trueandexternalize: true.I couldn't find any tests covering this edge case, so I added a fixture in
playground/ssr-resolve.Related issues/PRs: #8420 #8421.
Additional context
The current resolution produces an invalid path here
vite/packages/vite/src/node/plugins/resolve.ts
Lines 719 to 721 in e7712ff
In the case of
autosuggest-highlight,autosuggest-highlight/matchshould resolve toautosuggest-highlight/match/index.js, notautosuggest-highlight/match+.jswhich doesn't exist.with fix
without fix (main)
[processResult](autosuggest-highlight/match.jsdoesn't exist).What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).