How asset file with encodededURI path should be imported following vite 5.2 ? #16224
-
Following vite 5.2 and more specifically PR #15298 , import an asset file with encodededURI path is broken. For example, i want to import a file named import aFile from "./a%20file.json // broken with vite 5.2 The character What is the correct way to import an encodedURI asset following vite 5.2 ? thx |
Beta Was this translation helpful? Give feedback.
Answered by
sapphi-red
Mar 23, 2024
Replies: 1 comment 1 reply
-
It should work since 5.2.4 (#16244). That said, in native ESM, the import should be written as |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Jerboas86
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It should work since 5.2.4 (#16244). That said, in native ESM, the import should be written as
import aFile from "./a%2520file.json"
. Vite doesn't resolve that correctly though.I'd recommend avoid using
%
in a file name for now.