gatsby build is not preserving timestamps of existing files #37283
Unanswered
msurguy
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From Gatsby code, I see that during
gatbsy build
command, assets instatic
folder are copied over to thepublic
folder but their timestamps are not preserved, resulting in all assets in static folder to be re-uploaded again on subsequent deploys.Specifically I see that fs.copySync command is used here:
https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/get-static-dir.ts#L36
I was wondering why Gatsby developers did not include
preserveTimestamps: true
parameter to avoid this inefficiency. Here is the documentation of fs.copySync command: https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy-sync.mdCan anyone elaborate on why
preserveTimestamps: true
should not be included on line 36 ofget-static-dir
file?Beta Was this translation helpful? Give feedback.
All reactions