Skip to content

πŸ™Œ OpenHands: AI-Driven Development

feat: added make run-wsl (#2711)

tobitegeea3c58dc8ceb
diff --git a/Makefile b/Makefile
index 8d0b834de0..6b0f81c4ee 100644
--- a/Makefile
+++ b/Makefile
@@ -208,11 +208,10 @@ start-frontend:
@echo "$(YELLOW)Starting frontend...$(RESET)"
@cd frontend && VITE_BACKEND_HOST=$(BACKEND_HOST) VITE_FRONTEND_PORT=$(FRONTEND_PORT) npm run start
-# Run the app
-run:
- @echo "$(YELLOW)Running the app...$(RESET)"
+# Common setup for running the app (non-callable)
+_run_setup:
@if [ "$(OS)" = "Windows_NT" ]; then \
- echo "$(RED)`make run` is not supported on Windows. Please run `make start-frontend` and `make start-backend` separately.$(RESET)"; \
+ echo "$(RED) Windows is not supported, use WSL instead!$(RESET)"; \
exit 1; \
fi
@mkdir -p logs
@@ -221,9 +220,21 @@ run:
@echo "$(YELLOW)Waiting for the backend to start...$(RESET)"
@until nc -z localhost $(BACKEND_PORT); do sleep 0.1; done
@echo "$(GREEN)Backend started successfully.$(RESET)"
+
+# Run the app (standard mode)
+run:
+ @echo "$(YELLOW)Running the app...$(RESET)"
+ @$(MAKE) -s _run_setup
@cd frontend && echo "$(BLUE)Starting frontend with npm...$(RESET)" && npm run start -- --port $(FRONTEND_PORT)
@echo "$(GREEN)Application started successfully.$(RESET)"
+# Run the app (WSL mode)
+run-wsl:
+ @echo "$(YELLOW)Running the app in WSL mode...$(RESET)"
+ @$(MAKE) -s _run_setup
+ @cd frontend && echo "$(BLUE)Starting frontend with npm (WSL mode)...$(RESET)" && npm run dev_wsl -- --port $(FRONTEND_PORT)
+ @echo "$(GREEN)Application started successfully in WSL mode.$(RESET)"
+
# Setup config.toml
setup-config:
@echo "$(YELLOW)Setting up config.toml...$(RESET)"
@@ -308,4 +319,4 @@ help:
@echo " $(GREEN)help$(RESET) - Display this help message, providing information on available targets."
# Phony targets
-.PHONY: build check-dependencies check-python check-npm check-docker check-poetry pull-docker-image install-python-dependencies install-frontend-dependencies install-precommit-hooks lint start-backend start-frontend run setup-config setup-config-prompts help
+.PHONY: build check-dependencies check-python check-npm check-docker check-poetry pull-docker-image install-python-dependencies install-frontend-dependencies install-precommit-hooks lint start-backend start-frontend run run-wsl setup-config setup-config-prompts help
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 3bd8598ad2..e15a04a6b6 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -32,7 +32,12 @@ export default defineConfig(({ mode }) => {
return {
// depending on your application, base can also be "/"
base: "",
- plugins: [react(), viteTsconfigPaths()],
+ plugins: [
+ react({
+ include: "src/**/*.tsx",
+ }),
+ viteTsconfigPaths(),
+ ],
clearScreen: false,
server: {
watch: {