# wite-wue-ssr-test

> Vite utility for server side rendering

Latest version **0.5.49** (published 2023-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install wite-wue-ssr-test
pnpm add wite-wue-ssr-test
yarn add wite-wue-ssr-test
bun add wite-wue-ssr-test
```

Provides the command `wite-wue-ssr-test`.

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.49 |
| Published | 2023-09-19 |
| First published | 2021-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 80.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Martin Kirilov |
| Maintainers | wucdbm |
| Keywords | vite, vue, ssr |

## Links

- npm: https://www.npmjs.com/package/wite-wue-ssr-test
- Repository: https://github.com/wucdbm/wite-wue-ssr
- Homepage: https://github.com/wucdbm/wite-wue-ssr#readme
- Issues: https://github.com/wucdbm/wite-wue-ssr/issues
- npm.io page: https://npm.io/package/wite-wue-ssr-test

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.5.49 (latest) — 2023-09-19
- 0.5.48 — 2023-09-11
- 0.5.47 — 2023-09-11
- 0.5.46 — 2023-03-29
- 0.5.45 — 2023-03-02
- 0.5.44 — 2023-03-02
- 0.5.43 — 2023-01-25
- 0.5.42 — 2022-11-28
- 0.5.41 — 2022-11-28
- 0.5.40 — 2022-11-10
- 0.5.39 — 2022-11-09
- 0.5.38 — 2022-10-18
- 0.5.37 — 2022-10-18
- 0.5.36 — 2022-10-18
- 0.5.35 — 2022-10-18
- … 119 more at https://npm.io/package/wite-wue-ssr-test/versions

## README

# Vite Vue SSR 

Simple yet powerful Server Side Rendering for Vite 2 in Node.js for Vue.

-   ⚡ Lightning Fast HMR (powered by Vite, even in SSR mode).
-   💁‍♂️ Consistent DX experience abstracting some or most of the SSR complexity.
-   🔍 Small library, very opinionated of your project entry points, not at all opinionated about your page routing and API logic.
-   🔥 Fast and SEO friendly thanks to SSR, with SPA takeover for snappy UX.
-   🧱 Compatible with Vite's plugin ecosystem such as file-based routing, PWA, etc.

Vite SSR can be deployed to any Node.js or browser-like environment, including serverless platforms like Vercel, Netlify, or even Cloudflare Workers. It can also run with more traditional servers like Express.js or Fastify.

> Wite Wue SSR is based on the great work of https://github.com/frandiox/vite-ssr. In fact, I copied _all_ of his work and changed bits and pieces to match my own personal opinion about things. An example project is on the TODO list.

## Installation

Create a normal [Vite](https://vitejs.dev/guide/) project for Vue or React.

```sh
yarn create vite --template [vue|vue-ts]
```

Then, add `wite-wue-ssr` with your package manager (direct dependency) and your framework router.

```sh
yarn add wite-wue-ssr vue@3 vue-router@4 @vueuse/head
```

## Usage

[TODO] Add Vite SSR plugin to your Vite config file (see [`vite.config.js`](./examples/vue/vite.config.js) for a full example).

```js
// vite.config.js
import vue from '@vitejs/plugin-vue'
import { WiteWueSsrPlugin } from 'wite-wue-ssr-test/plugin'

export default {
    plugins: [WiteWueSsrPlugin(), vue()],
}
```

[TODO] Then, simply import the main Vite SSR handler in your main entry file as follows. See full examples for [Vue](./examples/vue/src/main.js).

_TODO_

```js
import App from './App' // Vue or React main app
import routes from './routes'
import { WiteWueSsrPlugin } from 'wite-wue-ssr-test/plugin'
// or from 'vite-ssr/vue' or 'vite-ssr/react', which slightly improves typings

export default viteSSR(App, { routes }, (context) => {
    /* Vite SSR main hook for custom logic */
    /* const { app, router, initialState, ... } = context */
})
```

If you need conditional logic that should only run in either client or server, use Vite's `import.meta.env.SSR` boolean variable and the tree-shaking will do the rest.

_TODO State Hydration_

---
_Source: https://npm.io/package/wite-wue-ssr-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
