-
-
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
fix: dynamic import path contain ../ and its own directory #9350
Conversation
Hi, are there any updates about this fix? |
let newRawPattern = posix.relative( | ||
posix.dirname(importer), | ||
await toAbsoluteGlob(rawPattern, root, importer, resolve) | ||
) | ||
|
||
if (!/^\.{1,2}\//.test(newRawPattern)) { | ||
newRawPattern = `./${newRawPattern}` | ||
} |
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 don't understand this logic, do we have enough tests for all cases here?
If importer is /root/dir/nested/importer.js
and toAbsoluteGlob
returns /root/foo/bar/{pattern}.js
, then newRawPattern
ends up being ./../foo/bar/{pattern}.js
🤔
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.
Ah, no.. I missed the !
. Ok, now I understand 😄
I still have a build error (Heroku)
|
@zyakita please create a new issue against the latest version of Vite with a minimal reproduction. Thanks! |
Description
fix: #9265
I think it should work properly
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).