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.
npm install -g vuepress@nextecho '# Hello VuePress!' > README.md.vuepress/config.jsmodule.exports = {
themeConfig: {
nav: [
{ text: 'home', link: '/' }
],
sidebarDepth: 2,
sidebar: {
'/': [
['', 'home']
]
}
}
}
vuepress dev ..vuepress/config.jsmodule.exports = {
themeConfig: {
nav: [
{ text: 'home', link: '/' }
],
sidebarDepth: 2,
sidebar: {
'/': [
['', 'newHome']
]
}
}
}
sidebar title 'home to newHome
no change
Websocket connection is normal.

而且默认设置并不生效,只能用 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图,希望它对你们有帮助。

@AJLoveChina 我也遇到同样的问题。在1.x下,必须指定 --temp 才能更新sidebar的目录。而这个问题在0.x是没有的。我并没有全局安装Vuepress,而是安装在项目目录下。
The same issue +1
The same issue +1
The same issue +1
Most helpful comment
@Xinyii 非常感谢你提供的帮助 :
vuepress dev . --temp .temp,它确实可行。在这之前,我在官方文档中找不到这行命令的说明,我被sidebar无法自动更新的问题困扰了很久。
在0.x的版本中,sidebar自动更新是可以正常工作的。
但是当我切换到1.x版本之后,sidebar就无法自动更新了
我特地制作了一个Gif图,希望它对你们有帮助。
