From 5c4c9c5278d5ed2900ca75e90fcb597207e493cb Mon Sep 17 00:00:00 2001 From: Abigail Hartman Date: Thu, 25 Jul 2024 17:43:44 -0700 Subject: [PATCH] Minor improvements to build process and startup scripts --- frontend/vite.config.ts | 2 +- start.cmd | 14 ++++++ start.sh | 96 +++++++++++++++++++++++++++++------------ 3 files changed, 84 insertions(+), 28 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 22452851bc..6bd76109ce 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ plugins: [react()], build: { outDir: '../static', - emptyOutDir: true, + emptyOutDir: false, sourcemap: true }, server: { diff --git a/start.cmd b/start.cmd index 5e19ecb145..b93cd4b30c 100644 --- a/start.cmd +++ b/start.cmd @@ -1,5 +1,18 @@ @echo off +setlocal +REM Sample app startup script +REM Process CLI options +set CMD=%~1 +if "%CMD%" == "" ( + echo Building the application. To skip this step in the future, use the `--skip-build` option. + goto build +) else if "%CMD%" == "--skip-build" ( + echo Skipping build... + goto run +) + +:build set NODE_OPTIONS=--max_old_space_size=8192 echo. @@ -30,6 +43,7 @@ if "%errorlevel%" neq "0" ( exit /B %errorlevel% ) +:run echo. echo Starting backend echo. diff --git a/start.sh b/start.sh index 9f59867d90..85b02baa07 100755 --- a/start.sh +++ b/start.sh @@ -1,34 +1,76 @@ -#!/bin/bash +#!/bin/bash -e + +# script usage info +function usage() { + cat <