Skip to content

Add Vite dev server proxy config and vite-proxy toggle script#25

Open
riccio82 wants to merge 1 commit intoOstico:masterfrom
riccio82:feature/vite-dev-proxy
Open

Add Vite dev server proxy config and vite-proxy toggle script#25
riccio82 wants to merge 1 commit intoOstico:masterfrom
riccio82:feature/vite-dev-proxy

Conversation

@riccio82
Copy link
Copy Markdown
Contributor

Summary

  • Adds Apache reverse proxy configuration (vite-dev-proxy.inc) for the Vite dev server — proxies HMR websocket, @vite, @fs, @react-refresh, public/, plugins/, node_modules/, vite-entries/ to localhost:5173 and sets VITE_DEV env var for PHP dev-mode asset injection
  • Adds #IncludeOptional line (commented out by default) to 443-matecat.conf
  • Adds vite-proxy CLI script installed to /usr/local/bin/ for toggling the proxy

Usage

# Inside the container
vite-proxy on       # Enable Apache → Vite proxy + set VITE_DEV=1
yarn watch          # Start Vite dev server with HMR
# ... develop ...
vite-proxy off      # Disable proxy, serve static builds
vite-proxy status   # Check current state (ON/OFF)

Context

Part of the Webpack → Vite migration for MateCat. The proxy configuration was previously applied manually inside running containers. This PR bakes it into the Docker image so it survives rebuilds.

Add Apache reverse proxy configuration for Vite dev server (HMR,
module resolution, source file serving) and a CLI helper script
to toggle the proxy on/off inside the container.

- vite-dev-proxy.inc: proxies @Vite, @fs, HMR websocket, public/,
  plugins/, node_modules/ to localhost:5173; sets VITE_DEV env var
  for PHP dev-mode asset injection; disables caching on proxied paths
- 443-matecat.conf: adds commented-out IncludeOptional for the proxy
- vite-proxy.sh: on/off/status CLI tool installed to /usr/local/bin
- Dockerfile: copies and chmods the vite-proxy script

Usage: vite-proxy on && yarn watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant