diff --git a/.changeset/fuzzy-falcons-tan.md b/.changeset/fuzzy-falcons-tan.md new file mode 100644 index 0000000000000..45323269d56ef --- /dev/null +++ b/.changeset/fuzzy-falcons-tan.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Marks internal `vite-plugin-fileurl` plugin with `enforce: 'pre'` diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 23a4068a8bda3..7fbfe60ddd717 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -151,7 +151,7 @@ export async function createVite( astroPrefetch({ settings }), astroTransitions({ settings }), astroDevToolbar({ settings, logger }), - vitePluginFileURL({}), + vitePluginFileURL(), astroInternationalization({ settings }), settings.config.experimental.serverIslands && vitePluginServerIslands({ settings }), astroContainer(), diff --git a/packages/astro/src/vite-plugin-fileurl/index.ts b/packages/astro/src/vite-plugin-fileurl/index.ts index 4a14323a07597..73132f3af979f 100644 --- a/packages/astro/src/vite-plugin-fileurl/index.ts +++ b/packages/astro/src/vite-plugin-fileurl/index.ts @@ -1,8 +1,9 @@ import type { Plugin as VitePlugin } from 'vite'; -export default function vitePluginFileURL({}): VitePlugin { +export default function vitePluginFileURL(): VitePlugin { return { name: 'astro:vite-plugin-file-url', + enforce: 'pre', resolveId(source, importer) { if (source.startsWith('file://')) { const rest = source.slice(7); diff --git a/packages/integrations/preact/src/signals.ts b/packages/integrations/preact/src/signals.ts index ad04ac9ce0cf4..89eaabd568dfa 100644 --- a/packages/integrations/preact/src/signals.ts +++ b/packages/integrations/preact/src/signals.ts @@ -37,8 +37,8 @@ export function serializeSignals( props[key] = props[key].map((v: SignalLike, i: number) => i === index ? [signal.peek(), i] : v, ); - map.set(key, [...((map.get(key) || []) as []), [signal, index]]); + signals[key] = [...((signals[key] || []) as []), [getSignalId(ctx, signal), index]]; } });