4

Is there a way to configure vuepress to look for the folder .vuepress somewhere else than default /docs?

1
  • 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. Commented Sep 6, 2019 at 5:33

2 Answers 2

0

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/:

  1. Create .vuepress/config.js in the parent directory of docs/.
  2. Edit that file to contain the following config:

    module.exports = {
      dest: 'foo' // desired path to VuePress output
    }
    
  3. Run vuepress build in the parent directory of docs/.

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.
Sign up to request clarification or add additional context in comments.

3 Comments

Unfortunately the parent level .vuepress does not seem to work any more. VuePress 1.5.0 demands the configuration to be in docs/.vuepress/config.js
@akauppi Thanks for the update! A simple workaround would be to symlink .vuepress so that docs/.vuepress links to the desired location.
I tried that, but then changed my mind. My intention is to keep my repo as approachable for visitors as possible, and symlinks often work against that.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.