-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix imports using ?raw and ?url not working when `experimental.assets…
…` is enabled (#7108)
- Loading branch information
1 parent
3420261
commit 4104286
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fix imports using ?raw and ?url not working when `experimental.assets` is enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/astro/test/fixtures/core-image/src/pages/vite.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
import imageRaw from "../assets/penguin1.jpg?raw"; | ||
import imageUrl from "../assets/penguin1.jpg?url"; | ||
const globImport = import.meta.glob('../assets/penguin1.jpg', { as: 'raw', eager: true }) | ||
--- | ||
|
||
<div id="url">{typeof imageUrl}</div> | ||
<div id="raw">{typeof imageRaw}</div> | ||
<div id="glob-import">{typeof globImport['../assets/penguin1.jpg']}</div> |