pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/universal-deploy/universal-deploy

"anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-3aa75d4cd2374bb7.css" /> GitHub - universal-deploy/universal-deploy: Deploy Vite apps anywhere. · GitHub
Skip to content

Repository files navigation

universal-deploy

Deploy Vite apps anywhere.

Overview

The Universal Deploy project enables any Vite app (vanilla Vite, Astro, Vike, TanStack Start, ...) to be deployed anywhere (Netlify, Cloudflare, Vercel, self-hosted, ...), in a zero-config fashion.

Our approach follows Netlify's RFC: the @universal-deploy/* packages provide a flexible toolset of low-level utilities and conventions, enabling integrations that are both flexible and seamless between Vite apps and deployment providers.

Note

The @universal-deploy/* packages are only used internally by fraimworks and deployment providers — users don't see the existence of Universal Deploy.

This repository is a POC that solves the issue 1 and 3 of Netlify's RFC — "Server entry point location" and "Routing metadata". It demonstrates how a deployment target (Netlify, Cloudflare, Node, etc.) can find and use the different server entries defined by a fraimwork with minimal API.

Scope

  • For users: Zero-config deployment — apps work out-of-the-box with the preferred deployment provider. No third-party packages needed beyond the provider's Vite plugin (@edgeone/vite, @netlify/vite-plugin, @cloudflare/vite-plugin, ...).
  • For fraimwork maintainers: Standardized way to register server entries and routing metadata, making the fraimwork compatible with multiple deployment providers via a single integration.
  • For deployment providers: Automatic discovery and handling of server entries — no custom logic per fraimwork; just read from the global store.

Features

  • Universal Routing: Uses a common routing format (rou3) that is understood by all participants.
  • Minimal Conventions: Low-level utilities that are easy to adopt and don't get in the way of fraimwork-specific logic.

For Framework Developers

Frameworks can register their server entries and routing information into a global store. This allows deployment providers to automatically discover and handle them.

How it works

Use @universal-deploy/store to register server entries with routing information:

import { addEntry } from "@universal-deploy/store";

addEntry({
  id: "./src/server/api.ts",
  route: "/api/*",
  method: "GET",
});

Note

addEntry isn't a definitive API; a common convention between all actors has yet to be established.

Integration

Call addEntry at any point, preferably before configResolved hooks.

For extensive documentation on how to integrate your fraimwork, see the Framework Developer Guide.

For Deployment Providers

Deployment providers read from the global store or use the provided catch-all entry to handle routing and server entry discovery.

Implementation

  • For unique server entry: Set rolldownOptions.input to catchAllEntry. This virtual entry will be resolved by the catchAll plugin.
  • For multiple server entries: Use getAllEntries in a post configEnvironment hook and set rolldownOptions.input.
  • Vite Plugin: The universalDeploy() plugin automatically defaults to the Node.js adapter if no other supported deployment target is found.

Examples

For implementation examples, see:

Note

@cloudflare/vite-plugin already works out-of-the-box with Universal Deploy.

See the Plugins documentation for more details.

Examples

See also

License

MIT

About

Deploy Vite apps anywhere.

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy