diff options
author | 2023-12-04 05:25:10 -0800 | |
---|---|---|
committer | 2023-12-04 14:25:10 +0100 | |
commit | 97e43022defaa9ddccd7bb62956d6cdda74bb36b (patch) | |
tree | 9dc211f26d12e9d8cc17738b8f9aa1fafc57d4fd | |
parent | 7a231e476380b2cf384c4afc20908932e3e347a4 (diff) | |
download | astro-97e43022defaa9ddccd7bb62956d6cdda74bb36b.tar.gz astro-97e43022defaa9ddccd7bb62956d6cdda74bb36b.tar.zst astro-97e43022defaa9ddccd7bb62956d6cdda74bb36b.zip |
[Toolbar] Improve third party plugin load performance (#9281)
-rw-r--r-- | packages/astro/src/runtime/client/dev-overlay/entrypoint.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/astro/src/runtime/client/dev-overlay/entrypoint.ts b/packages/astro/src/runtime/client/dev-overlay/entrypoint.ts index 2124c21e0..d2145d9ee 100644 --- a/packages/astro/src/runtime/client/dev-overlay/entrypoint.ts +++ b/packages/astro/src/runtime/client/dev-overlay/entrypoint.ts @@ -1,12 +1,14 @@ import type { DevOverlayPlugin as DevOverlayPluginDefinition } from '../../../@types/astro.js'; import { type AstroDevOverlay, type DevOverlayPlugin } from './overlay.js'; import { settings } from './settings.js'; +// @ts-expect-error +import {loadDevOverlayPlugins} from 'astro:dev-overlay'; let overlay: AstroDevOverlay; document.addEventListener('DOMContentLoaded', async () => { const [ - { loadDevOverlayPlugins }, + customPluginsDefinitions, { default: astroDevToolPlugin }, { default: astroAuditPlugin }, { default: astroXrayPlugin }, @@ -23,8 +25,7 @@ document.addEventListener('DOMContentLoaded', async () => { DevOverlayIcon, }, ] = await Promise.all([ - // @ts-expect-error - import('astro:dev-overlay'), + loadDevOverlayPlugins() as DevOverlayPluginDefinition[], import('./plugins/astro.js'), import('./plugins/audit.js'), import('./plugins/xray.js'), @@ -239,7 +240,6 @@ document.addEventListener('DOMContentLoaded', async () => { }, } satisfies DevOverlayPluginDefinition; - const customPluginsDefinitions = (await loadDevOverlayPlugins()) as DevOverlayPluginDefinition[]; const plugins: DevOverlayPlugin[] = [ ...[ astroDevToolPlugin, |