Skip to content

Commit

Permalink
fix: do not print if there is no payload fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Barbapapazes committed Nov 12, 2023
1 parent 5246c54 commit a934690
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineNuxtConfig({
},
routeRules: {
'/api/hello': {
prerender: true,
prerender: false,
},
},
})
5 changes: 5 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export default defineNuxtModule<ModuleOptions>({
})

nitro.hooks.hook('close', () => {
if (payloadsPaths.length === 0) {
nitro.logger.info('No payloads found')
return
}

nitro.logger.info('Nuxt Payload Analyzer')

const payloads = getPayloads(payloadsPaths)
Expand Down

0 comments on commit a934690

Please sign in to comment.