Skip to content

Commit

Permalink
perf: use direct imports from #app/nuxt and #imports
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jan 7, 2025
1 parent 736102b commit 70ef740
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/runtime/components/NuxtImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@

<script setup lang="ts">
import { computed, onMounted, ref, useAttrs } from 'vue'
import { useHead } from '@unhead/vue'
import { useImage } from '../composables'
import { parseSize } from '../utils'
import { prerenderStaticImages } from '../utils/prerender'
import { markFeatureUsage } from '../utils/performance'
import { imgProps, useBaseImage } from './_base'
import { useNuxtApp } from '#app'
import { useHead } from '#imports'
import { useNuxtApp } from '#app/nuxt'
const props = defineProps(imgProps)
Expand Down
7 changes: 5 additions & 2 deletions src/runtime/components/NuxtPicture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@

<script setup lang="ts">
import type { Head } from '@unhead/vue'
import { useHead } from '@unhead/vue'
import { computed, onMounted, ref, useAttrs } from 'vue'
import { prerenderStaticImages } from '../utils/prerender'
import { markFeatureUsage } from '../utils/performance'
import { getFileExtension } from '../utils'
import { useImage } from '../composables'
import { useBaseImage, pictureProps, baseImageProps } from './_base'
import { useNuxtApp } from '#app'
import { useHead } from '#imports'
import { useNuxtApp } from '#app/nuxt'
const props = defineProps(pictureProps)
Expand Down

0 comments on commit 70ef740

Please sign in to comment.