Optionally skip "Building production JavaScript and CSS bundles" #30788
Unanswered
gburgett
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'd love to know if there's a way to skip the "Building production JavaScript and CSS bundles" step.
For our setup, all the page templates and CSS bundles are version controlled in Git and only change when we merge to master and deploy. The majority of time, we run
gatsby build
in response to content editors making changes in Contentful.At the moment, the "Building production Javascript and CSS bundles" step is taking about 1/3 of the total time to build, and it seems unnecessary except in case of a new deploy. Is that correct?
One potential solution is that we could provide a Git commit hash in the Gatsby config. Then the webpack config could set the output to "filename:
[name]-${options.commitHash || '[contenthash]'}.js
", and inbuild.ts
if the file "public/production-app-${options.commitHash}
" exists, completely skip thebuildProductionBundle
step.This behavior would be completely opt-in, so that the developer assumes responsibility for ensuring that the commit hash is correct and changes when the new bundle needs to be built.
Beta Was this translation helpful? Give feedback.
All reactions