File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @hono/vite-ssg ' : minor
3+ ---
4+
5+ add ssg build option to specify extensionMap
Original file line number Diff line number Diff line change 11import type { Hono } from 'hono'
2- import { toSSG } from 'hono/ssg'
2+ import { toSSG , defaultExtensionMap } from 'hono/ssg'
33import type { SSGPlugin } from 'hono/ssg'
44import type { Plugin , ResolvedConfig } from 'vite'
55import { createServer } from 'vite'
@@ -13,11 +13,13 @@ type SSGOptions = {
1313 * @see https://hono.dev/docs/helpers/ssg#plugins
1414 */
1515 plugins ?: SSGPlugin [ ]
16+ extensionMap ?: Record < string , string >
1617}
1718
1819export const defaultOptions : Required < SSGOptions > = {
1920 entry : './src/index.tsx' ,
2021 plugins : [ ] ,
22+ extensionMap : defaultExtensionMap ,
2123}
2224
2325export const ssgBuild = ( options ?: SSGOptions ) : Plugin => {
@@ -90,7 +92,11 @@ export const ssgBuild = (options?: SSGOptions): Plugin => {
9092 return
9193 } ,
9294 } ,
93- { dir : outDir , plugins : options ?. plugins ?? defaultOptions . plugins }
95+ {
96+ dir : outDir ,
97+ plugins : options ?. plugins ?? defaultOptions . plugins ,
98+ extensionMap : options ?. extensionMap ?? defaultOptions . extensionMap ,
99+ }
94100 )
95101
96102 server . close ( )
You can’t perform that action at this time.
0 commit comments