Skip to content

Commit 80f899b

Browse files
committed
shell script cleanup
1 parent 058d99e commit 80f899b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

desktop/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ portfinder
1212
port: basePort,
1313
})
1414
.then((port) => {
15-
const devServer = `./scripts/start-dev-with-auto-restart.sh --port ${port} --env platform=desktop --no-open`;
15+
const devServer = `./scripts/start-dev-with-auto-restart.sh --port ${port} --env platform=desktop`;
1616
const buildMain = 'webpack watch --config config/webpack/webpack.desktop.ts --config-name desktop-main --mode=development';
1717

1818
const env = {

scripts/start-dev-with-auto-restart.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ RESTART_DELAY=1
1212
echo "🚀 Starting webpack-dev-server with auto-restart (max restarts: $MAX_RESTARTS)"
1313

1414
run_wds () {
15-
node --expose-gc ./node_modules/.bin/webpack-dev-server "$1" "${WDS_ARGS[@]}" --config config/webpack/webpack.dev.ts
15+
# Check if platform is Desktop to determine open behavior
16+
if [[ "${WDS_ARGS[*]}" == *"--env platform=desktop"* ]]; then
17+
# For Desktop, always use --no-open since app is handled by Electron
18+
node --expose-gc --max-old-space-size=1100 ./node_modules/.bin/webpack-dev-server --no-open "${WDS_ARGS[@]}" --config config/webpack/webpack.dev.ts
19+
else
20+
# For Web, use the provided open flag
21+
node --expose-gc ./node_modules/.bin/webpack-dev-server "$1" "${WDS_ARGS[@]}" --config config/webpack/webpack.dev.ts
22+
fi
1623
}
1724

1825
while [ $RESTART_COUNT -lt $MAX_RESTARTS ]; do

0 commit comments

Comments
 (0)