Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vite is supposed to prefix asset [1] URLs with the base / origin, and you can see this working for url() in CSS (otherwise the Wikidata logo would be broken), but due to vitejs/vite-plugin-vue#85 [2] this doesn’t work for <img> src= attributes. Work around it by importing the importing the files and then using that URL dynamically. (In the tests, we need to map those imports to a fake module so Jest doesn’t try to load the real file content as JS source.) [1]: https://vitejs.dev/guide/assets.html [2]: vitejs/vite-plugin-vue#85 Bug: T335754 Change-Id: Ie3c1cf9c225c646b2f7d94727a634e9ff78aad4e
- Loading branch information
1 parent
d8d88c7
commit 4621760
Showing
4 changed files
with
15 additions
and
3 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
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
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 @@ | ||
module.exports = ''; |