Skip to content

Commit

Permalink
fix: avoid explicit nitropack imports
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed May 6, 2024
1 parent f275c7a commit 21a38ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/runtime/nitro/plugins/nuxt-content.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { defu } from 'defu'
import { defineNitroPlugin } from 'nitropack/dist/runtime/plugin'
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import type { NitroApp } from 'nitropack'
import type { SitemapUrl } from '../../types'
import { useSimpleSitemapRuntimeConfig } from '../utils'
import { defineNitroPlugin } from '#imports'

export default defineNitroPlugin((nitroApp) => {
export default defineNitroPlugin((nitroApp: NitroApp) => {
const { discoverImages, isNuxtContentDocumentDriven } = useSimpleSitemapRuntimeConfig()
// @ts-expect-error runtime type
// @ts-expect-error untyped
nitroApp.hooks.hook('content:file:afterParse', async (content: ParsedContent) => {
const validExtensions = ['md', 'mdx']
if (content.sitemap === false || content._draft || !validExtensions.includes(content._extension) || content._partial || content.indexable === false || content.index === false)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/nitro/plugins/warm-up.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineNitroPlugin } from 'nitropack/dist/runtime/plugin'
import { withLeadingSlash } from 'ufo'
import { useSimpleSitemapRuntimeConfig } from '../utils'
import { defineNitroPlugin } from '#imports'

export default defineNitroPlugin((nitroApp) => {
const { sitemaps } = useSimpleSitemapRuntimeConfig()
Expand Down

0 comments on commit 21a38ca

Please sign in to comment.