自动站点更新检测脚本 npm install publish-version-checker or yarn add publish-version-checker import VersionChecker from 'publish-version-checker' new VersionChecker({ onUpdate: (done) => { const res = confirm('检测到新版本,是否要更新') if (res) { done(true) window.location.reload() } else { done(false) } } })