Skip to content

Hot reload doesn't normal work without --temp .temp #1536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
xinyii opened this issue Apr 12, 2019 · 8 comments
Closed
1 task done

Hot reload doesn't normal work without --temp .temp #1536

xinyii opened this issue Apr 12, 2019 · 8 comments
Labels
type: enhancement Request to enhance an existing feature

Comments

@xinyii
Copy link

xinyii commented Apr 12, 2019

  • 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
@xinyii
Copy link
Author

xinyii commented Apr 13, 2019

temp文档描述

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

@timaschew
Copy link
Contributor

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.

@ulivz ulivz added the type: enhancement Request to enhance an existing feature label Apr 14, 2019
@ulivz
Copy link
Member

ulivz commented Apr 14, 2019

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.

@AJLoveChina
Copy link

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

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

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

@Molunerfinn
Copy link

Molunerfinn commented Jun 11, 2019

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

@quanzaiyu
Copy link

The same issue +1

@Akimotorakiyu
Copy link

The same issue +1

1 similar comment
@nbgmtin
Copy link

nbgmtin commented Oct 3, 2019

The same issue +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Request to enhance an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants