@hono/vite-ssg
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@hono/vite-ssg

@hono/vite-ssg is a Vite plugin to generate a static site from your Hono application.

Usage

Installation

You can install vite and @hono/vite-ssg via npm.

npm i -D vite @hono/vite-ssg

Or you can install them with Bun.

bun add vite @hono/vite-ssg

Settings

Add "type": "module" to your package.json. Then, create vite.config.ts and edit it.

import { defineConfig } from 'vite'
import ssg from '@hono/vite-ssg'

export default defineConfig({
  plugins: [ssg()],
})

Build

Just run vite build.

npm exec vite build

Or

bunx --bun vite build

Deploy to Cloudflare Pages

Run the wrangler command.

wrangler pages deploy ./dist

Options

The options are below.

type SSGOptions = {
  entry?: string
}

Default values:

const defaultOptions = {
  entry: './src/index.tsx',
}

Authors

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @hono/vite-ssg

Weekly Downloads

1,057

Version

0.1.0

License

MIT

Unpacked Size

4.63 kB

Total Files

6

Last publish

Collaborators

  • yusukebe