[heft] Fix an issue where heft would crash when copying static assets in --watch mode. #2557
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
There is an issue where
heft build --watch
will crash when a file listed as a static asset to copy to the "lib" folder(s) is edited. This issue was introduced when support for automatically detecting the "lib" folder specified as theoutDir
intsconfig.json
was added. That path has to be resolved relative to thetsconfig.json
file that specifies it, which may be a file specified in an"extends"
property.Details
This PR adds a
resolvedDestinationFolderPaths
property to theCopyFilesPlugin
copy operation descriptor which is preemptively resolved to an absolute path.How it was tested
Tested by building a large project containing .scss files both in
--watch
and not in--watch
mode.