fix(gatsby-transformer-sharp): Dereference symlinks when copying files #31511
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.
Description
Without dereferencing the symlink itself is copied which has two problems:
gatsby clean
to be able to build again.As this is the second time, I stumble upon an issue of this sort it Gatsby, I wonder if anything can be done to prevent the same issue from cropping up again in the future? But I don't see anything obvious or cheap solution ...
Why do I have symlinks?
My Gatsby site has many images and committing them directly to the Git repository wouldn't be a good idea due to the file size.Instead I'm using git-annex which replaces the files with relative symbolic links.
Related Issues
An equivalent fix was previously done for gatsby-source-filesystem in #24025.