-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
fix(ssr): no external symlink package #9296
Conversation
undefined, | ||
true, | ||
true // try to externalize, will return undefined if not possible | ||
false |
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.
We need to pass true here or the branch testing deep imports will not be evaluated
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.
It is also filtering .css files when passing true, we need more tests in ssr-deps 🤔
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.
Hmm I changed to false so we can resolve to the full path to analyze node_modules
though. I'll try to find another way for this. Otherwise resolving linked-dep
would return linked-dep
, which doesn't give enough heuristic
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.
You could do these checks inside tryNodeResolve when passing true
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.
Thanks for the hint. Now the fix is a lot simpler than before 😅
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.
Nice! I think we still need a refactoring to make the branches more clear, we can get there in 3.1
We should still respect |
|
Description
Fix sveltejs/kit#5542
If a package is symlinked, we should not externalize it by default as we usually treat them as source code instead, in this case, we no externalize it. This PR handles this.
Additional context
Also refactored the logic flowThe ssr external function only returnsboolean
withoutundefined
as we're not using theundefined
value anywhereWhat is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).