From 22cccb0ab19c542aba679305e6b82d8a9cb33551 Mon Sep 17 00:00:00 2001 From: Bogdan Kostyuk Date: Wed, 19 Jul 2023 18:30:12 +0300 Subject: [PATCH] feat(nuxt): polyfill idle callback utils (#21863) --- packages/nuxt/src/app/index.ts | 1 + packages/nuxt/src/imports/presets.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/index.ts b/packages/nuxt/src/app/index.ts index 70ea4e391c..bd23bc8e74 100644 --- a/packages/nuxt/src/app/index.ts +++ b/packages/nuxt/src/app/index.ts @@ -4,6 +4,7 @@ export * from './nuxt' export * from './composables/index' export * from './components/index' export * from './config' +export * from './compat/idle-callback' // eslint-disable-next-line import/no-restricted-paths export type { PageMeta } from '../pages/runtime/index' diff --git a/packages/nuxt/src/imports/presets.ts b/packages/nuxt/src/imports/presets.ts index 7e3d741f58..8625302b8e 100644 --- a/packages/nuxt/src/imports/presets.ts +++ b/packages/nuxt/src/imports/presets.ts @@ -60,7 +60,9 @@ const appPreset = defineUnimportPreset({ 'preloadPayload', 'isPrerendered', 'definePayloadReducer', - 'definePayloadReviver' + 'definePayloadReviver', + 'requestIdleCallback', + 'cancelIdleCallback' ] })