You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 refactor: add conditional RUNNER variable for Windows compatibility (#572)
This PR improves Windows build compatibility by introducing a
conditional `RUNNER` variable in the Makefile.
## Changes
- **Add RUNNER variable** that conditionally uses:
- `npx` on Windows (where `bun x` doesn't correctly pass arguments)
- `bun x` on non-Windows systems for better performance
- **Update all 30+ commands** to use `$(RUNNER)` instead of hardcoded
`bun x` or `npx`
- **Add explanatory comments** for Windows-specific behavior
## Why this matters
On Windows, `bun x` doesn't correctly pass arguments to commands,
causing build failures. This change ensures consistent build behavior
across all platforms by using the appropriate tool for each OS.
## Implementation
```makefile
ifeq ($(OS),Windows_NT)
# Windows: Use npm/npx because bun x doesn't correctly pass arguments
RUNNER := npx
else
# Non-Windows: Use bun x for better performance
RUNNER := bun x
endif
```
All commands now use `$(RUNNER)` for cross-platform compatibility.
_Generated with `cmux`_
# On Windows, use npm run because bunx doesn't correctly pass arguments to concurrently
107
+
# https://github.com/oven-sh/bun/issues/18275
108
+
@NODE_OPTIONS="--max-old-space-size=4096" npm x concurrently -k --raw \
109
+
"bun x nodemon --exec node scripts/build-main-watch.js"\
110
+
"vite"
111
+
else
112
+
dev: node_modules/.installed build-main ## Start development server (Vite + tsgo watcher for 10x faster type checking)
113
+
@bun x concurrently -k \
114
+
"bun x concurrently \"$(TSGO) -w -p tsconfig.main.json\"\"bun x tsc-alias -w -p tsconfig.main.json\""\
107
115
"vite"
116
+
endif
108
117
109
118
clean-cache: ## Clean Vite cache (helps with EMFILE errors on Windows)
110
119
@echo "Cleaning Vite cache..."
111
120
@rm -rf node_modules/.vite
112
121
122
+
ifeq ($(OS),Windows_NT)
113
123
dev-server: node_modules/.installed build-main ## Start server mode with hot reload (backend :3000 + frontend :5173). Use VITE_HOST=0.0.0.0 BACKEND_HOST=0.0.0.0 for remote access
dev-server: node_modules/.installed build-main ## Start server mode with hot reload (backend :3000 + frontend :5173). Use VITE_HOST=0.0.0.0 BACKEND_HOST=0.0.0.0 for remote access
0 commit comments