Repository navigation
[widget-preview] Copy host web directory to widget preview scaffold - #188595
Merged
auto-submit[bot] merged 3 commits intoJun 26, 2026
Merged
Conversation
|
This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled. |
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces functionality to copy the host's web directory to the widget preview scaffold directory when starting the widget preview, and includes a test to verify this behavior. Feedback suggests deleting the destination web directory in the scaffold before copying to prevent stale files from persisting on subsequent runs.
srawlins
previously approved these changes
Jun 26, 2026
srawlins
approved these changes
Jun 26, 2026
This was referenced Jun 27, 2026
This was referenced Jun 29, 2026
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.
Fixes #179577
When
flutter widget-preview startis run, it generates a scaffold project. However, it was not copying the host project'sweb/directory to the scaffold. This caused web-specific bootstrap resources (like customindex.htmlor scripts required by dependencies) to be missing, leading to crashes or failures on startup if dependencies required them.This PR fixes the issue by copying the host project's
web/directory (if it exists) to the scaffold project:web/directory are synced to the scaffold.A unit test has been added to verify that the host
web/directory is correctly copied to the scaffold.