Is there a way to configure vuepress to look for the folder .vuepress somewhere else than default /docs?
-
Hello from 2019--the new VuePress documentation site annoyingly doesn't have any way to navigate to the page, but they explain the recommended directory structure here.MLQ– MLQ2019-09-06 05:33:14 +00:00Commented Sep 6, 2019 at 5:33
2 Answers
UPDATE: VuePress 1.5.0 now only reads from docs/.vuepress, so the workaround below no longer works. However, another possible (less elegant) workaround is to symlink the docs/.vuepress to the desired location (tested on macOS Catalina).
For example, you could symlink it to <projectRoot>/.vuepress on macOS with:
mkdir .vuepress docs
cd docs
ln -s ../.vuepress
As of VuePress 0.12.0, there's no specific configuration to set the location of .vuepress/. VuePress always looks for .vuepress/ in the target directory (docs/) and the immediate parent directory. If not found, VuePress creates .vuepress/ in the parent directory of docs/.
If your objective is to prevent the creation of docs/.vuepress/ and you didn't mind .vuepress/ in the parent directory of docs/:
- Create
.vuepress/config.jsin the parent directory ofdocs/. Edit that file to contain the following config:
module.exports = { dest: 'foo' // desired path to VuePress output }Run
vuepress buildin the parent directory ofdocs/.
The result of the above config is to create a directory foo/ with the VuePress static site output:
$ vuepress build
WAIT Extracting site metadata...
[2:20:45 AM] Compiling Client
[2:20:45 AM] Compiling Server
(node:47073) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[2:20:48 AM] Compiled Server in 3s
[2:20:50 AM] Compiled Client in 5s
WAIT Rendering static HTML...
DONE Success! Generated static files in foo.
3 Comments
.vuepress so that docs/.vuepress links to the desired location.Don't think there is. In 2018, the author has stated:
I don't see practical value in this except for personal preference, so probably not.