in

Experimental test runner based on vite


vavite is a Vite plugin that provides SSR functionality that is environment, cloud, framework, and meta-framework agnostic. It achieves this by means of “environment adapters” that convert the request representation of their specific environment into an environment-agnostic representation, calls your request handler, and converts the environment-agnostic response representation returned from your handler into whatever the specific environment expects. It also provides escape hatches for direct handling of the environment-specific request or the response.

Adapters for Vite’s development server and Node.js are built in. @vavite/cloudflare-workers, @vavite/netlify, and @vavite/vercel packages provide adapters for Cloudflare Workers, Netlify Functions, and Vercel respectively.

sirv which is used for serving static files (because your reverse proxy already does it, for instance). You can also use vavite/middleware to build a connect-style middleware instead of a full application.

If you’re using an adapter, the dev server works the same way while the build will create a bundle suitable for the target environment.

Accessing client build artifacts

Your server-side code can access the manifests from the client build by importing them via vavite/manifest and vavite/ssr-manifest. In dev mode, the SSR manifest will be an empty object while the client manifest will be a special proxy object that maps each file to itself.

You can also access the content of index.html (if it exists) in its processed form by importing vavite/html. In dev, it will return the unprocessed index.html: vavite will call transformIndexHtml for you if your response’s content type is text/html.

When authoring an adapter or a custom entry, user’s handler module is accessible via vavite/handler.

View Github




Leaflet JS getBound to TileLayer

Jio vs Vi vs Bharti Airtel Affordable 1GB/Day Prepaid Plans Compared