Replies: 1 comment 4 replies
-
I’d probably opt for something like this in your {
"scripts": {
"build": "astro build --outDir _temp && rm -rf dist && mv _temp dist"
}
} It’s not 100% zero downtime I guess though because there is a brief gap between files being deleted and replaced. Depends on your requirements. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
I want to be able to reexecute
npm run build
without downtimes. So if a dist-folder is already present, I would want build to build to somewhere else, and then swap those folders, if/when building succeeded.Background & Motivation
I want to use Astro for a static site but still allow CMS-Changes via statamic. I have no fast rebuild-requirements. For my needs it would be enough to rebuild every few minutes (maybe via cron). I am also not using a CDN / hoster like vercel which would me allow to do that easily. I am using classic bare metal webservers.
Goals
Example
run build
builds into.$target
rm -rf ${target} && mv ".$target" $target
Beta Was this translation helpful? Give feedback.
All reactions