Vuepress: Hot reload doesn't normal work without --temp .temp

Created on 12 Apr 2019  ·  8Comments  ·  Source: vuejs/vuepress




  • [x] I confirm that this is an issue rather than a question.




Bug report

If you do not set --temp .temp, hot reload can only reload markdown, but can not reload config.js files, navigation bar, sidebar title, front matter, etc.

Version

Steps to reproduce

  1. npm install -g vuepress@next
  2. echo '# Hello VuePress!' > README.md
  3. Create file .vuepress/config.js
module.exports = {
  themeConfig: {
    nav: [
      { text: 'home', link: '/' }
    ],
    sidebarDepth: 2,
    sidebar: {
      '/': [
        ['', 'home']
      ]
    }
  }
}
  1. vuepress dev .
  2. Edit file .vuepress/config.js
module.exports = {
  themeConfig: {
    nav: [
      { text: 'home', link: '/' }
    ],
    sidebarDepth: 2,
    sidebar: {
      '/': [
        ['', 'newHome']
      ]
    }
  }
}

What is expected?

sidebar title 'home to newHome

What is actually happening?

no change

Other relevant information

Websocket connection is normal.

  • Your OS: Windows 10
  • Node.js version: v11.2.0
  • Browser version: Google Chrome 73.0.3683.103
  • Is this a global or local install? global
  • Which package manager did you use for the install? npm 6.4.1
  • Does this issue occur when all plugins are disabled? yes
enhancement

Most helpful comment

@Xinyii 非常感谢你提供的帮助vuepress dev . --temp .temp,它确实可行。
在这之前,我在官方文档中找不到这行命令的说明,我被sidebar无法自动更新的问题困扰了很久。

在0.x的版本中,sidebar自动更新是可以正常工作的。
但是当我切换到1.x版本之后,sidebar就无法自动更新了

我特地制作了一个Gif图,希望它对你们有帮助。
vue-press-sidebar-bug3

All 8 comments

temp文档描述

而且默认设置并不生效,只能用 vuepress dev . --temp .temp

I've realized that changing (adding or deletigin items) in the sidebar are not properly hot-reloaded.
Renaming existing items works fine.

Navbar is not affected.

Since you're using a globally installed vuepress, the temp files will be placed under the global installed directory so that VuePress cannot detect the change of it.


BTW, the docs has been updated.

@Xinyii 非常感谢你提供的帮助vuepress dev . --temp .temp,它确实可行。
在这之前,我在官方文档中找不到这行命令的说明,我被sidebar无法自动更新的问题困扰了很久。

在0.x的版本中,sidebar自动更新是可以正常工作的。
但是当我切换到1.x版本之后,sidebar就无法自动更新了

我特地制作了一个Gif图,希望它对你们有帮助。
vue-press-sidebar-bug3

@AJLoveChina 我也遇到同样的问题。在1.x下,必须指定 --temp 才能更新sidebar的目录。而这个问题在0.x是没有的。我并没有全局安装Vuepress,而是安装在项目目录下。

The same issue +1

The same issue +1

The same issue +1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tinchox5 picture tinchox5  ·  3Comments

lesliecdubs picture lesliecdubs  ·  3Comments

alinnert picture alinnert  ·  3Comments

gaomd picture gaomd  ·  3Comments

zeke picture zeke  ·  3Comments