0.5.49 • Published 8 months ago

wite-wue-ssr-test v0.5.49

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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 project for Vue or React.

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

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

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 for a full example).

// 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.

TODO

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

0.5.49

8 months ago

0.5.47

8 months ago

0.5.48

8 months ago

0.5.43

1 year ago

0.5.44

1 year ago

0.5.45

1 year ago

0.5.46

1 year ago

0.5.41

1 year ago

0.5.42

1 year ago

0.5.40

2 years ago

0.5.32

2 years ago

0.5.33

2 years ago

0.5.38

2 years ago

0.5.39

2 years ago

0.5.36

2 years ago

0.5.37

2 years ago

0.5.34

2 years ago

0.5.35

2 years ago

0.5.10

2 years ago

0.5.11

2 years ago

0.5.18

2 years ago

0.5.19

2 years ago

0.5.16

2 years ago

0.5.17

2 years ago

0.5.14

2 years ago

0.5.15

2 years ago

0.5.12

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.9

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.4.0

2 years ago

0.6.6

2 years ago

0.6.9

2 years ago

0.6.8

2 years ago

0.6.10

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.14

2 years ago

0.6.13

2 years ago

0.5.4

2 years ago

0.1.8

2 years ago

0.5.3

2 years ago

0.1.7

2 years ago

0.5.6

2 years ago

0.1.9

2 years ago

0.5.0

2 years ago

0.1.4

2 years ago

0.5.2

2 years ago

0.1.6

2 years ago

0.5.1

2 years ago

0.1.5

2 years ago

0.5.30

2 years ago

0.5.31

2 years ago

0.5.21

2 years ago

0.5.22

2 years ago

0.5.20

2 years ago

0.5.29

2 years ago

0.5.27

2 years ago

0.5.28

2 years ago

0.5.25

2 years ago

0.5.26

2 years ago

0.5.23

2 years ago

0.5.24

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.6

2 years ago

0.6.5

2 years ago

0.2.9

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.40

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.37

3 years ago

0.0.15

3 years ago

0.0.38

3 years ago

0.0.16

3 years ago

0.0.39

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.12

3 years ago

0.0.35

3 years ago

0.0.13

3 years ago

0.0.36

3 years ago

0.0.14

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago