Edit

Netlify

You can use Netlify to deploy static websites as well as SSR.

If you pre-render partially, then your pre-rendered pages are statically deployed while your SSR pages are served dynamically.

Get started

1. Set +server

If you didn't already, define +server.js with your favorite server (Hono, Express, ...), or set +server to true to use Vike's built-in lightweight server.

2. Install

Install the Netlify Vite adapter:

npm install @netlify/vite-plugin
pnpm add @netlify/vite-plugin
bun add @netlify/vite-plugin
yarn add @netlify/vite-plugin
// vite.config.js
 
import vike from 'vike/plugin'
import netlify from '@netlify/vite-plugin'
 
export default {
  plugins: [
    vike(),
    netlify({ 
      build: { 
        enabled: true
      } 
    }) 
 ]
}

The build command remains $ vike build.

3. Deploy

Git Connection Deployment

Push your project to GitHub, GitLab, or Bitbucket, then connect it to Netlify.

CLI Deployment

Install the Netlify CLI:

npm install -g netlify-cli
pnpm add -g netlify-cli
bun add --global netlify-cli
yarn global add netlify-cli

Then deploy:

netlify deploy --prod

Manual integration

You can also manually integrate your Vike app with Netlify Functions.

Example: