Skip to content

Commit

Permalink
Make vite-plugin-fileurl a pre plugin (withastro#11822)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Aug 25, 2024
1 parent a3b9b91 commit 6fcaab8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-falcons-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Marks internal `vite-plugin-fileurl` plugin with `enforce: 'pre'`
2 changes: 1 addition & 1 deletion packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/src/vite-plugin-fileurl/index.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 6fcaab8

Please sign in to comment.