Custom vue component in markdown needs to declare a static asset from prop #4619
-
I use a custom vue component in markdown, and this component loads data from a json file to render it. This json file currently lives next to the markdown file. # My markdown content
<MyComponent src="./landscape_0.json" /> This works fine in the dev build, but after a production build the json file is not found. Can I somehow declare the json file as a static asset? Currently the component loads the json with a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Few options -
|
Beta Was this translation helpful? Give feedback.
You can manually specify
?url
for now I guess - https://stackblitz.com/edit/vite-bukpxmwg?file=docs/index.md,docs/.vitepress/config.tsor update the logic of component to something like