Skip to content

Commit

Permalink
fix(prerender): remove baseURL from generated file paths (#329)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Roe <daniel@roe.dev>
  • Loading branch information
farnabaz and danielroe authored Aug 1, 2022
1 parent db1d087 commit 26c15ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pathToFileURL } from 'url'
import { resolve, join } from 'pathe'
import { parseURL, withBase } from 'ufo'
import { parseURL, withBase, withoutBase } from 'ufo'
import chalk from 'chalk'
import { createNitro } from './nitro'
import { build } from './build'
Expand Down Expand Up @@ -64,6 +64,7 @@ export async function prerender (nitro: Nitro) {
const isImplicitHTML = !route.endsWith('.html') && (res.headers.get('content-type') || '').includes('html')
const routeWithIndex = route.endsWith('/') ? route + 'index' : route
_route.fileName = isImplicitHTML ? route + '/index.html' : routeWithIndex
_route.fileName = withoutBase(_route.fileName, nitro.options.baseURL)

await nitro.hooks.callHook('prerender:generate', _route, nitro)

Expand Down

0 comments on commit 26c15ca

Please sign in to comment.