Skip to content

Commit

Permalink
fix: revert nitropack workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 1, 2022
1 parent 668dd23 commit 583a61a
Show file tree
Hide file tree
Showing 2 changed files with 221 additions and 145 deletions.
9 changes: 2 additions & 7 deletions src/module.ts
Expand Up @@ -33,13 +33,8 @@ export default defineNuxtModule<ModuleOptions>({
...options.config,
})
nitro.hooks.hook('prerender:generate', async route => {
if (!route.fileName?.endsWith('.html')) return
if ('data' in route) {
const contents = new TextDecoder('utf-8').decode(new Uint8Array(route.data!))
route.data = new TextEncoder().encode(await critters.process(contents))
} else if (route.contents) {
route.contents = await critters.process(route.contents!)
}
if (!route.fileName?.endsWith('.html') || !route.contents) return
route.contents = await critters.process(route.contents)
})
})

Expand Down

0 comments on commit 583a61a

Please sign in to comment.