From dd4e50103fd85ac4a812109ce5ec9dd8a50c85aa Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Tue, 24 Oct 2023 09:12:37 +0200 Subject: [PATCH] fix(frontend): delete mock public directory only for production Signed-off-by: Tilman Vatteroth --- frontend/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/build.sh b/frontend/build.sh index 92ef3e096..27575a9b7 100755 --- a/frontend/build.sh +++ b/frontend/build.sh @@ -42,7 +42,12 @@ cp -R .next/static dist/frontend/.next/static cp next.config.js dist/frontend/next.config.js cp -R public dist/frontend/public rm -f dist/frontend/.env -rm -rf dist/frontend/public/public + +if [ "${NODE_ENV}" = "production" ]; then + echo "🦔 > Remove public directory because this is a production build" + rm -rf dist/frontend/public/public +fi + rm -rf dist/frontend/src echo "🦔 > Done! You can run the build by going into the dist directory and executing \`node frontend/server.js\`"