Refactor development workflow for scheduling-remote
- Updated dev:watch script in package.json to streamline the build and serve process. - Removed start-dev.sh script as its functionality is now integrated into the npm command.
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
"build:watch": "vite build --watch",
|
"build:watch": "vite build --watch",
|
||||||
"serve:dist": "serve -s dist -l 3003",
|
"serve:dist": "serve -s dist -l 3003",
|
||||||
"preview": "vite preview --port 3003",
|
"preview": "vite preview --port 3003",
|
||||||
"dev:watch": "./start-dev.sh"
|
"dev:watch": "npm run build && (npm run build:watch &) && sleep 1 && npx http-server dist -p 3003 --cors -c-1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@supabase/supabase-js": "^2.52.0",
|
"@supabase/supabase-js": "^2.52.0",
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Build the project first
|
|
||||||
echo "Building scheduling-remote..."
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
# Start build:watch in the background
|
|
||||||
echo "Starting build:watch in background..."
|
|
||||||
npm run build:watch &
|
|
||||||
|
|
||||||
# Wait for remoteEntry.js to exist before starting the server
|
|
||||||
# Check both possible locations (root and assets folder)
|
|
||||||
echo "Waiting for remoteEntry.js to be generated..."
|
|
||||||
MAX_WAIT=30
|
|
||||||
WAIT_COUNT=0
|
|
||||||
REMOTE_ENTRY_ROOT="dist/remoteEntry.js"
|
|
||||||
REMOTE_ENTRY_ASSETS="dist/assets/remoteEntry.js"
|
|
||||||
|
|
||||||
while [ $WAIT_COUNT -lt $MAX_WAIT ]; do
|
|
||||||
# Check if file exists in either location
|
|
||||||
if [ -f "$REMOTE_ENTRY_ROOT" ] || [ -f "$REMOTE_ENTRY_ASSETS" ]; then
|
|
||||||
echo "remoteEntry.js found! Starting http-server..."
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 1
|
|
||||||
WAIT_COUNT=$((WAIT_COUNT + 1))
|
|
||||||
if [ $((WAIT_COUNT % 5)) -eq 0 ]; then
|
|
||||||
echo "Still waiting for remoteEntry.js... (${WAIT_COUNT}s)"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Final check
|
|
||||||
if [ ! -f "$REMOTE_ENTRY_ROOT" ] && [ ! -f "$REMOTE_ENTRY_ASSETS" ]; then
|
|
||||||
echo "ERROR: remoteEntry.js was not generated after ${MAX_WAIT} seconds!"
|
|
||||||
echo "Checked locations: $REMOTE_ENTRY_ROOT and $REMOTE_ENTRY_ASSETS"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starting http-server on port 3003..."
|
|
||||||
npx http-server dist -p 3003 --cors -c-1
|
|
||||||
Reference in New Issue
Block a user