Skip to content

Commit

Permalink
fix: useNitroApp import warning
Browse files Browse the repository at this point in the history
Closes #340
  • Loading branch information
harlan-zw committed Aug 16, 2024
1 parent 15686c4 commit f5ab878
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/nitro/routes/sitemap_index.xml.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { appendHeader, defineEventHandler, setHeader } from 'h3'
import { joinURL } from 'ufo'
import { useNitroApp } from 'nitropack/runtime'
import { useSimpleSitemapRuntimeConfig } from '../utils'
import { buildSitemapIndex, urlsToIndexXml } from '../sitemap/builder/sitemap-index'
import type { SitemapOutputHookCtx } from '../../types'
import { useNitroUrlResolvers } from '../sitemap/nitro'
import { useNitroApp } from '#imports'

export default defineEventHandler(async (e) => {
const runtimeConfig = useSimpleSitemapRuntimeConfig()
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/nitro/sitemap/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getQuery, setHeader } from 'h3'
import type { H3Event } from 'h3'
import { fixSlashes } from 'site-config-stack/urls'
import { defu } from 'defu'
import { useNitroApp } from 'nitropack/runtime'
import type {
ModuleRuntimeConfig,
NitroUrlResolvers,
Expand All @@ -14,7 +15,7 @@ import { createNitroRouteRuleMatcher } from '../kit'
import { buildSitemapUrls, urlsToXml } from './builder/sitemap'
import { normaliseEntry } from './urlset/normalise'
import { sortSitemapUrls } from './urlset/sort'
import { createSitePathResolver, getPathRobotConfig, useNitroApp, useSiteConfig } from '#imports'
import { createSitePathResolver, getPathRobotConfig, useSiteConfig } from '#imports'

export function useNitroUrlResolvers(e: H3Event): NitroUrlResolvers {
const canonicalQuery = getQuery(e).canonical
Expand Down

0 comments on commit f5ab878

Please sign in to comment.