-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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: avoid null sourcePath in server.sourcemapIgnoreList
#12251
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
@danielroe was it discussed if we should call
sourcemapIgnoreList
using thesourcePath
after 303? I don't know what is best here, but maybe it isn't a bad idea to get the path that will end up showing in the dev tools?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 think @bmeurer and I felt it would be better to call it with an absolute path: #12174 (comment).
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 reference, I missed that one. @bmeurer what is the reason you consider safer to go with absolute paths? My first reaction while reading those messages was of suggesting to align as close as possible with rollup (we still have time to change this if we think it is better).
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.
rollup passes project relative paths. I guess that would be fine here as well, but I'm not sure how to reconstruct the project relative paths here.
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 checked with a fresh create-vite Vue Typescript app, and the paths I currently get are:
So it looks like the
sourcePath
in rollup is relative to thesourcemapPath
, no?For dev we get
The ones we care about in this discussion are the
.vue
files and themain.ts
. So, if we want to align with rollup, I think sourcePath would end up beingmain.ts
,App.vue
, andHelloWorld.vue
. So the file relative to.map
path ofsourcemapPath
. This means that users should mainly be usingsourcemapPath
to do the condition instead of sourcePath during dev. The absolute path seems easier to work with as a user. Maybe the alignment isn't that important here. cc @bluwy @sapphi-red for a second opinion.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 think it's worth aligning with Rollup here to avoid the confusion that it works in dev, and later not in builds. We could rename the first param as
relativeSourcePath
like Rollup so it's consistent.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.
SGTM.