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.
- **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
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.
```makefile
ifeq ($(OS),Windows_NT)
RUNNER := npx
else
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
112
+
# https://github.com/oven-sh/bun/issues/18275
113
+
@NODE_OPTIONS="--max-old-space-size=4096" npm x concurrently -k --raw \
114
+
"bun x nodemon --exec node scripts/build-main-watch.js"\
115
+
"vite"
116
+
else
117
+
dev: node_modules/.installed build-main ## Start development server (Vite + tsgo watcher for 10x faster type checking)
118
+
@bun x concurrently -k \
119
+
"bun x concurrently \"$(TSGO) -w -p tsconfig.main.json\"\"bun x tsc-alias -w -p tsconfig.main.json\""\
112
120
"vite"
121
+
endif
113
122
114
123
clean-cache: ## Clean Vite cache (helps with EMFILE errors on Windows)
115
124
@echo "Cleaning Vite cache..."
116
125
@rm -rf node_modules/.vite
117
126
127
+
ifeq ($(OS),Windows_NT)
118
128
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