# @universal-deploy/vite

> Automatically enables the Node.js adapter if no other deployment target (Vercel, Cloudflare, Netlify) is detected in the Vite configuration.

Latest version **0.1.12** (published 2026-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @universal-deploy/vite
pnpm add @universal-deploy/vite
yarn add @universal-deploy/vite
bun add @universal-deploy/vite
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.12 |
| Published | 2026-09-21 |
| First published | 2026-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Maintainers | brillout, magne4000, nitedani |

## Links

- npm: https://www.npmjs.com/package/@universal-deploy/vite
- Repository: https://github.com/photon-js/universal-deploy
- Homepage: https://github.com/photon-js/universal-deploy#readme
- Issues: https://github.com/photon-js/universal-deploy/issues
- npm.io page: https://npm.io/package/@universal-deploy/vite

## Dependencies (6)

- [rou3](https://npm.io/package/rou3.md) ^0.8.1
- [magic-string](https://npm.io/package/magic-string.md) ^0.30.21
- [@universal-deploy/node](https://npm.io/package/@universal-deploy/node.md) ^0.1.11
- [@universal-deploy/store](https://npm.io/package/@universal-deploy/store.md) ^0.2.2
- [@universal-deploy/netlify](https://npm.io/package/@universal-deploy/netlify.md) ^0.2.3
- [@universal-middleware/express](https://npm.io/package/@universal-middleware/express.md) ^0.4.31

## Recent versions

- 0.1.12 (latest) — 2026-09-21
- 0.1.11 — 2026-08-05
- 0.1.10 — 2026-05-25
- 0.1.9 — 2026-05-06
- 0.1.8 — 2026-05-04
- 0.1.7 — 2026-04-13
- 0.1.6 — 2026-04-08
- 0.1.5 — 2026-04-08
- 0.1.4 — 2026-04-08
- 0.1.3 — 2026-04-03
- 0.1.2 — 2026-04-02
- 0.1.1 — 2026-04-01
- 0.1.0 — 2026-03-11

## README

## @universal-deploy/vite

Automatically enables the Node.js adapter if no other deployment target (Vercel, Cloudflare, Netlify) is detected in the Vite configuration.

### Installation

```bash
pnpm add -D @universal-deploy/vite
```

### Usage

Add the `universalDeploy` plugin to your `vite.config.ts`:

```ts
import universalDeploy from "@universal-deploy/vite";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    universalDeploy(),
    // ... other plugins
  ],
});
```

Are you a framework developer? Read the [Framework Developer Guide](../../docs/framework-developers.md) to learn how to integrate `@universal-deploy/vite` into your framework.

### How it works

The `universalDeploy()` plugin detects the presence of other deployment adapters in your Vite configuration. If any of the following plugins are found, it automatically disables its own Node.js adapter injection:

- `vite-plugin-vercel`
- `@cloudflare/vite-plugin`
- `@netlify/vite-plugin` (also requires `@universal-deploy/netlify` for compatibility)

If none of these are present, it enables `@universal-deploy/node` to provide a default Node.js-compatible server build.

### Options

The `universalDeploy()` plugin accepts the following options:

- `node`: Same options as the `@universal-deploy/node` adapter:
    - `static`: (string | boolean) The directory containing static assets. Defaults to the client output directory.
    - `importer`: (string) The importer to use when resolving the server entry.
    - `precompress`: (boolean | object) Emit `.br`/`.gz` variants of the static assets at build time and serve those instead of compressing per request. Off by default; see the [adapter README](../adapter-node/README.md#precompress).
- `entry`: (string) Relative or absolute path to override the default server entry.

---
_Source: https://npm.io/package/@universal-deploy/vite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
