Zero-config deep integration between Vite apps and deployment providers.
Contents
Extend Universal Deploy: deeper integration between Vite apps and deployment — support features like SPA fallback, async jobs, ...
Everything stays zero-config: Vite apps can be deployed out-of-the-box with minimal config.
Note
Vite
We're currently focusing on the Vite ecosystem — supporting other bundlers is a long-term goal but not a short-term priority.
Support for:
- URL rewrites — use cases:
- SPA fallback (e.g. serve
dist/client/product/index.htmlfor all URLs/product/:id, i.e./product/42,/product/1337, ...) - 404 page (serve
dist/client/404/index.htmlas a catch-all fallback)
- SPA fallback (e.g. serve
- URL redirects
Note
Marketing
It's a quick-win for a deployment provider to position itself as the best solution for hosting static websites. Vike (and others) will, accordingly, recommend its users to use such deployment provider. It's an effective way to earn trust and popularity amongst users.
Note
Implementation
Universal Deploy has been developed with such features in mind — implementation is relatively easy.
How can the user define async tasks, queues, and cron jobs in a way that works across many (and eventually most) deployment providers?
Note
Implementation
The implementation itself is relatively easy — this is mostly about research to find a (new?) standard syntax. For example, whether we can use the UNIX cron syntax as the standard syntax.
CLI integration:
$ vite deploy logs=> server logs$ vite deploy status=> deployment status, downtime status for past 30 days, ...$ vite deploy ls=> number of server processes, system metrics (CPU usage, mem usage), pending tasks, ...$ vite deploy db=> connect to DB and run queries, e.g.SELECT { title, release_date } FROM movies;$ vite deploy db migrate=> run migrations
$ vite secrets=> manage production environment variables (e.g.DB_PASSWORD)# Set a secret $ vite deploy secrets set DB_PASSWORD lOK9uiUuCP75lMzQ # Get all secrets $ vite deploy secrets list
Note
Motivation: AI
AI cannot (practically) work with UIs — the CLI enables AI to access deployment data (such as deployment logs for debugging).
Note
Implementation
- At first, we implement
$ vike deployinstead of$ vite deploy - We talk to the Vite team about adding
$ vite deployto Vite's CLI:- The Vite team has repeatedly shown interest in having Vite plugins be able to extend Vite's CLI (e.g. for further enabling frameworks to be "just Vite plugins")
- We're currently working with the Vite team on Vite deployment plugins. Having
$ vite deployis a natural next step.
How will deployment providers integrate with AI workflows in the future?
Example:
- Error detected in deployment => AI is automatically prompted => AI can access deployment logs => AI proposes fix => human review => fix is merged & deployed
- Only human intervention is reviewing the bug fix, everything else is automatic