-
-
Notifications
You must be signed in to change notification settings - Fork 124
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: double modules hazard by preferring relative paths #645
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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.
looks like we are almost there!
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.
Almost.
@@ -165,23 +165,21 @@ export const devServer: Middleware = (options) => { | |||
vitePromise, | |||
]); | |||
|
|||
if (!initialModules) { |
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.
What's the reason behind this?
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.
related with #601?
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.
yea just removed it because it was not needed, not any other reason. And it worked this way.
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.
const file = ( | ||
filePath.slice(config.basePath.length).startsWith('@fs/') | ||
? filePath.slice((config.basePath + '@fs').length) | ||
: filePath | ||
).split('?')[0]!; | ||
const wakuDist = joinPath( | ||
fileURLToFilePath(import.meta.url), | ||
'../../..', | ||
); | ||
if (file.startsWith(wakuDist)) { | ||
const fileWithAbsolutePath = | ||
!file.startsWith(opts.rootDir) && !file.startsWith(wakuDist) | ||
? encodeFilePathToAbsolute(joinPath(opts.rootDir, file)) | ||
: file; | ||
if ( | ||
file.startsWith(wakuDist) || | ||
fileWithAbsolutePath.startsWith(wakuDist) |
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.
This part looks a little bit complicated and has room for improvement.
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 makes /user/project/src/comp.tsx into /src/comp.tsx
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.
Yeah, but this entire block can be refactored for more readability, no?
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.
Hm, I think we can remove L279.
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.
Hm, I think we can remove L279.
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.
should be good.
Everything's passing, congrats! |
close #631