fix(host): getScriptSnapshot must also call fileNames.add#364
Merged
Conversation
- the `fileNames` Set that was previously introduced in c86e07b caused a regression during watch mode - this is because `setSnapshot` was updated to call `this.fileNames.add`, but `getScriptSnapshot` was not - instead of updating both to be the same, we can just call `setSnapshot` from `getScriptSnapshot` as this code is supposed to be identical - also rename `data` -> `source` for consistency and clarity (`source` is a more specific name)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Make
getScriptSnapshotmatch/callsetSnapshot. Previously, athis.fileNames.addcall was added tosetSnapshotbut notgetScriptSnapshot, causing aCould not find source fileerror.Could not find source filewhen running in watch mode withrollup-plugin-vue#271Details
fileNamesSet that was previously introduced in the fix for Error:Could not find filewhen extraneous TS files in project anddeclaration: true#95 (this line in the commit) caused a regression during watch modesetSnapshotwas updated to callthis.fileNames.add, butgetScriptSnapshotwas notsetSnapshotfromgetScriptSnapshotas this code is supposed to be identicaldata->sourcefor consistency and clarity (sourceis a more specific name)See #271 (comment) and my other comment above it for a root cause analysis.