Skip to content

Commit

Permalink
fix: add warning for SPA usage
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Nov 15, 2023
1 parent c85f61e commit ab27e5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export default defineNuxtModule<ModuleOptions>({
logger.debug('The module is disabled, skipping setup.')
return
}
if (!nuxt.options.ssr && nuxt.options.dev)
logger.warn('You are using Schema.org with SSR disabled. This is not recommended, Google may not detect your Schema.org, and it adds extra page weight')

const { resolve } = createResolver(import.meta.url)
await installNuxtSiteConfig()

Expand Down
6 changes: 1 addition & 5 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ export default defineNuxtPlugin({
path: route.path,
}
})
useHead({
templateParams: {
schemaOrg,
},
})
head.push({ templateParams: { schemaOrg } })
head.use(
SchemaOrgUnheadPlugin({}, async () => {
const meta = {}
Expand Down

0 comments on commit ab27e5b

Please sign in to comment.