1.0.11 • Published 1 year ago
redu-utils v1.0.11
安装
npm i redu-utils
# 或者
yarn add redu-utils
# 或者
pnpm add redu-utils
// 示例
import { VersionUpdate } from 'redu-utils'
const env = import.meta.env.VITE_NODE_ENV
const basePath = import.meta.env.VITE_ROOT_PATH
const isLocal = env === 'custome'
new VersionUpdate({
localstroageKey: 'version', // 本地存储的版本号的key
timeout: 60 * 1000 * 30, // 轮询时间
htmlFileUrl: `${basePath}index.html`, // 请求html文件的url
envExecute: !isLocal, // 是否执行版本更新
})