forked from trent_larson/crowd-funder-for-time-pwa
grr: experimental diagnosis and fix for build:web:serve
This commit is contained in:
@@ -203,8 +203,11 @@ execute_vite_build() {
|
||||
local mode="$1"
|
||||
log_info "Executing Vite build for $mode mode..."
|
||||
|
||||
# Set git hash environment variable
|
||||
export VITE_GIT_HASH=$(git log -1 --pretty=format:%h)
|
||||
|
||||
# Construct Vite build command
|
||||
local vite_cmd="VITE_GIT_HASH=\$(git log -1 --pretty=format:%h) npx vite build --config vite.config.web.mts"
|
||||
local vite_cmd="npx vite build --config vite.config.web.mts"
|
||||
|
||||
# Add mode if not development (development is default)
|
||||
if [ "$mode" != "development" ]; then
|
||||
@@ -256,8 +259,11 @@ execute_docker_build() {
|
||||
start_dev_server() {
|
||||
log_info "Starting Vite development server..."
|
||||
|
||||
# Set git hash environment variable
|
||||
export VITE_GIT_HASH=$(git log -1 --pretty=format:%h)
|
||||
|
||||
# Construct Vite dev server command
|
||||
local vite_cmd="VITE_GIT_HASH=\$(git log -1 --pretty=format:%h) npx vite --config vite.config.web.mts"
|
||||
local vite_cmd="npx vite --config vite.config.web.mts"
|
||||
|
||||
# Add mode if specified (though development is default)
|
||||
if [ "$BUILD_MODE" != "development" ]; then
|
||||
@@ -266,9 +272,11 @@ start_dev_server() {
|
||||
|
||||
log_debug "Vite dev server command: $vite_cmd"
|
||||
log_info "Starting development server on http://localhost:8080"
|
||||
log_info "Press Ctrl+C to stop the server"
|
||||
|
||||
# Start the development server (this will block and run the server)
|
||||
eval "$vite_cmd"
|
||||
# Note: This command will not return until the server is stopped
|
||||
exec $vite_cmd
|
||||
}
|
||||
|
||||
# Function to serve build locally
|
||||
|
||||
Reference in New Issue
Block a user