You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for creating Vitepress - it's an amazing tool. I really appreciate all the hard work that goes into maintaining it.
Description
When configuring Vitepress with a srcDir that points to a directory outside the project root, the build process fails with a "Rollup failed to resolve import 'vue'" error.
$ vitepress build
vitepress v1.6.3
x Build failed in 12ms
✖ building client + server bundles...
build error:
[vite]: Rollup failed to resolve import "vue" from "/xxxxx/vitepress-src-dir-bug/api-examples.md".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
[vite]: Rollup failed to resolve import "vue" from "/xxxxx/vitepress-src-dir-bug/api-examples.md".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
$ git clone https://github.com/kawamataryo/vitepress-src-dir-bug
$ cd vitepress-example
$ yarn
$ yarn docs:dev // It work
$ yarn docs:build // It don't work
Expected behavior
Vitepress should successfully build the documentation regardless of the srcDir location.
Hmm, the issue is that it needs vue to be resolvable from that markdown file. So, srcDir technically works, but you need to install vitepress on the outer package.json. This structure will work:
First of all, thank you for creating Vitepress - it's an amazing tool. I really appreciate all the hard work that goes into maintaining it.
Description
When configuring Vitepress with a
srcDir
that points to a directory outside the project root, the build process fails with a "Rollup failed to resolve import 'vue'" error.Reproduction
I've created a reproduction repository: vitepress-src-dir-bug
Reproduce step
Expected behavior
Vitepress should successfully build the documentation regardless of the
srcDir
location.System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: