Skip to content
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

插件导致热重载失效, 而每次直接刷新页面 #95

Closed
4 tasks done
lincenying opened this issue Jul 21, 2023 · 3 comments
Closed
4 tasks done

插件导致热重载失效, 而每次直接刷新页面 #95

lincenying opened this issue Jul 21, 2023 · 3 comments

Comments

@lincenying
Copy link

描述问题

image
image

图1, 是用了插件, 每次修改代码, 保存后, vite都会发送full-reload给客服端, 导致页面直接刷新, 而不是热重载
图2, 删除了插件后, 恢复正常

复现

https://github.com/lincenying/vite-uniapp-vue3

用pnpm安装依赖后, 将 vite.config.ts 里的 UniPages 的相关注释删了

运行服务, 打开F12, 修改src/pages/index.vue, 保存文件, 页面直接刷新

系统信息

System:
    OS: macOS 12.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 93.11 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.20.0 - ~/.nvm/versions/node/v16.20.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.0/bin/npm
    pnpm: 8.6.9 - ~/work/mpapp/chaikaji/node_modules/.bin/pnpm
  Browsers:
    Chrome: 114.0.5735.248
    Safari: 15.5

使用的包管理器

pnpm

核对

  • 遵循我们的 行为准则
  • 检查是否已经有一个报告相同错误的问题,以避免重复创建。
  • 这是一个具体的错误。请开启 GitHub 讨论你的疑问。
  • 所提供的复现是这个问题的 最小复现
@KeJunMao
Copy link
Member

确实是的,啊好烦不知道怎么修

@lincenying
Copy link
Author

确实是的,啊好烦不知道怎么修

我现在是暂时把 node_modules/vite/dist/client/client.mjs 里的 case 'full-reload': 改成了 case 'full-reload111':

需要全刷的时候, 手动刷

@KeJunMao KeJunMao reopened this Jul 25, 2023
@KeJunMao
Copy link
Member

等我有了好想法我修下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants