GreatAuk / plugin-web-update-notification

Detect webpage updates and notify user to reload. support Vite, Umijs, and Webpack.
MIT License
490 stars 42 forks source link

vitepress项目配置了该插件也不支持,打包后的index.html没有pluginWebUpdateNotice相关的引入 #56

Open YaroED opened 9 months ago

YaroED commented 9 months ago

【@plugin-web-update-notification/vite'】1.7.0

import { webUpdateNotice } from '@plugin-web-update-notification/vite'

webUpdateNotice({ versionType: 'custom', customVersion: '1.0.1', // default: '0.0.0 logVersion: true, checkInterval: 0, notificationProps: { title: "📢 system update", description: "System update, please refresh the page", buttonText: "refresh", dismissButtonText: "dismiss", }, notificationConfig: { primaryColor: "red", secondaryColor: "blue", placement: "topRight", }, })

rex-ll commented 6 months ago

+1

ArthurDarkstone commented 2 months ago
image

https://github.com/vuejs/vitepress/issues/3314

这是一个vitepress 的问题,pluginWebUpdateNotice 内部使用了transformIndexHtml这个hook。

但是在vitepress 使用 vite 构建文档时,不会调用transformIndexHtml。建议等待官方修复后,升级vitepress 至最新版本