0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-31 23:31:30 -05:00

Make vite-plugin-fileurl a pre plugin (#11822)

This commit is contained in:
Bjorn Lu 2024-08-25 20:23:07 +08:00 committed by GitHub
parent a3b9b91caf
commit 6fcaab84de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Marks internal `vite-plugin-fileurl` plugin with `enforce: 'pre'`

View file

@ -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(),

View file

@ -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);