vuepress
vuepress copied to clipboard
Using import inside .md files in vuepress v2
Hello there,
First of all: thanks for creating and maintaining such a cool open-source documentation project! I really enjoyed working with vuepress v2 so far.
But now I'm struggling with the following:
I'd like to import a variable from clientAppEnhance.ts inside myArticle.md.
My file structure looks like this:
docs/
βββ .vuepress/
β βββ clientAppEnhance.ts
βββ guide/
βββ myArticle.md
I tried the following inside myArticle.md, which doesn't work:
<script setup>
import { myVar } from '../.vuepress/clientAppEnhance'
// do something with myVar
</script>
Error message:
Failed to resolve import "../.vuepress/clientAppEnhance" from "docs/.vuepress/.temp/pages/guide/myArticle.html.vue".
Does the file exist?
Is there a way to achieve this? Maybe by using or defining some path alias? I've looked up and down all documentation pages but couldn't find anythingβ¦
Thanks for any hint and answers. β€οΈ
This is VuePress 1 repo, please ensure you are using correct version and reading correct docs, VuePress 2 repo are at VuePress/VuePress-next