Skip to content

Commit 82f4380

Browse files
committed
added browser --no-open on auto-restart
1 parent b0452bd commit 82f4380

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/web-server-with-restart.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55

66
MAX_RESTARTS=10
77
RESTART_COUNT=0
8-
RESTART_DELAY=3
8+
RESTART_DELAY=1
99

1010
echo "🚀 Starting webpack-dev-server with auto-restart (max restarts: $MAX_RESTARTS)"
1111

1212
run_wds () {
13-
node --expose-gc "$(npm root)/webpack-dev-server/bin/webpack-dev-server.js" --open --config config/webpack/webpack.dev.ts
13+
node --expose-gc "$(npm root)/webpack-dev-server/bin/webpack-dev-server.js" $1 --config config/webpack/webpack.dev.ts
1414
}
1515

1616
while [ $RESTART_COUNT -lt $MAX_RESTARTS ]; do
1717
echo "📊 Attempt #$((RESTART_COUNT + 1)) - Starting webpack-dev-server..."
1818

19-
# Run webpack-dev-server with memory monitoring
20-
run_wds
19+
if [ $RESTART_COUNT -eq 0 ]; then
20+
run_wds --open
21+
else
22+
run_wds --no-open
23+
fi
2124

2225
# Capture exit code
2326
EXIT_CODE=$?

0 commit comments

Comments
 (0)