import type { InlinePreset } from 'unimport' import { defineUnimportPreset } from 'unimport' const commonPresets: InlinePreset[] = [ // vue-demi (mocked) defineUnimportPreset({ from: 'vue-demi', imports: [ 'isVue2', 'isVue3' ] }) ] const granularAppPresets: InlinePreset[] = [ { from: '#app/components/nuxt-link', imports: ['defineNuxtLink'] }, { imports: ['useNuxtApp', 'defineNuxtPlugin', 'definePayloadPlugin', 'useRuntimeConfig', 'defineAppConfig'], from: '#app/nuxt' }, { imports: ['requestIdleCallback', 'cancelIdleCallback'], from: '#app/compat/idle-callback' }, { imports: ['useAppConfig', 'updateAppConfig'], from: '#app/config' }, { imports: ['defineNuxtComponent'], from: '#app/composables/component' }, { imports: ['useAsyncData', 'useLazyAsyncData', 'useNuxtData', 'refreshNuxtData', 'clearNuxtData'], from: '#app/composables/asyncData' }, { imports: ['useHydration'], from: '#app/composables/hydrate' }, { imports: ['useState', 'clearNuxtState'], from: '#app/composables/state' }, { imports: ['clearError', 'createError', 'isNuxtError', 'showError', 'useError'], from: '#app/composables/error' }, { imports: ['useFetch', 'useLazyFetch'], from: '#app/composables/fetch' }, { imports: ['useCookie'], from: '#app/composables/cookie' }, { imports: ['prerenderRoutes', 'useRequestHeaders', 'useRequestEvent', 'useRequestFetch', 'setResponseStatus'], from: '#app/composables/ssr' }, { imports: ['onNuxtReady'], from: '#app/composables/ready' }, { imports: ['preloadComponents', 'prefetchComponents', 'preloadRouteComponents'], from: '#app/composables/preload' }, { imports: ['abortNavigation', 'addRouteMiddleware', 'defineNuxtRouteMiddleware', 'setPageLayout', 'navigateTo', 'useRoute', 'useRouter'], from: '#app/composables/router' }, { imports: ['isPrerendered', 'loadPayload', 'preloadPayload', 'definePayloadReducer', 'definePayloadReviver'], from: '#app/composables/payload' }, { imports: ['getAppManifest', 'getRouteRules'], from: '#app/composables/manifest' }, { imports: ['reloadNuxtApp'], from: '#app/composables/chunk' }, { imports: ['useRequestURL'], from: '#app/composables/url' } ] // This is a separate preset as we'll swap these out for import from `vue-router` itself in `pages` module const routerPreset = defineUnimportPreset({ imports: ['onBeforeRouteLeave', 'onBeforeRouteUpdate'], from: '#app/composables/router' }) // vue const vuePreset = defineUnimportPreset({ from: 'vue', imports: [ //