How can I import files as text #4857
Answered
by
bluwy
LokiMidgard
asked this question in
Q&A
-
I need to import a xml file. I used declare module '*.xml' {
const content: string;
export default content;
} When running the App I get following error.
I assume the file gets loaded as JS. How can I tell svelte to just load the file as text? |
Beta Was this translation helpful? Give feedback.
Answered by
bluwy
May 10, 2022
Replies: 1 comment
-
Use the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
LokiMidgard
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the
?raw
suffix:import nota from './../data/nota.xml?raw';
https://vitejs.dev/guide/assets.html#importing-asset-as-string