@@ -17,7 +17,7 @@ import { mergeConfig, resolveConfig, build as viteBuild } from 'vite'
17
17
import { serializeState } from '../utils/state'
18
18
import { getBeasties } from './critical'
19
19
import { renderPreloadLinks } from './preload-links'
20
- import { buildLog , getSize , routesToPaths } from './utils'
20
+ import { buildLog , getSize , prepareHtmlFileName , routesToPaths } from './utils'
21
21
22
22
export type Manifest = Record < string , string [ ] >
23
23
@@ -55,6 +55,7 @@ export async function build(ssgOptions: Partial<ViteSSGOptions> = {}, viteConfig
55
55
concurrency = 20 ,
56
56
rootContainerId = 'app' ,
57
57
base,
58
+ htmlFileName,
58
59
} : ViteSSGOptions = mergedOptions
59
60
60
61
const beastiesOptions = mergedOptions . beastiesOptions ?? { }
@@ -196,9 +197,12 @@ export async function build(ssgOptions: Partial<ViteSSGOptions> = {}, viteConfig
196
197
? `${ route } index`
197
198
: route ) . replace ( / ^ \/ / g, '' ) } .html`
198
199
199
- const filename = dirStyle === 'nested'
200
- ? join ( route . replace ( / ^ \/ / g, '' ) , 'index.html' )
201
- : relativeRouteFile
200
+ const filename = await prepareHtmlFileName (
201
+ dirStyle === 'nested'
202
+ ? join ( route . replace ( / ^ \/ / g, '' ) , 'index.html' )
203
+ : relativeRouteFile ,
204
+ htmlFileName ,
205
+ )
202
206
203
207
await fs . mkdir ( resolve ( out , dirname ( filename ) ) , { recursive : true } )
204
208
await fs . writeFile ( resolve ( out , filename ) , formatted , 'utf-8' )
0 commit comments