We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
当我开启了硬盘缓存,可是我还加了一个元数据获取失败兜底函数,这个时候只会走硬盘缓存逻辑,兜底函数不生效了
const obj = { enableDiskCache: true, apiPrefix: item.apiPrefix, versionId: item.version, hook: { beforeAppendAssetNode(passCtx) { const { url, setAssetUrl } = passCtx; const jsdelivrUrl = url.replace('https://unpkg.com', item.apiPrefix); setAssetUrl(jsdelivrUrl); }, onFetchMetaFailed(params) { // 返回一份前端预设的元数据对象,用于兜底 console.log('开始走兜底逻辑', params); console.log('备用cdn数据', _DATA); return _DATA; }, }, }; try { const helMicro = await import('hel-micro'); SDK = await helMicro.preFetchLib(item.sdk, obj); } catch (e) { console.log('捕获到异常错误', e); }
The text was updated successfully, but these errors were encountered:
会优化为,开启硬盘缓存功能后,如果抓取失败后,
1 有硬盘缓存,无 onFetchMetaFailed 钩子,则使用硬盘缓存 2 有硬盘缓存,有 onFetchMetaFailed 钩子,则透传硬盘缓存对象给钩子做参考 2.1,钩子无任何返回则继续使用硬盘缓存 2.2,钩子有具体的返回元数据则采用用户的元数据
Sorry, something went wrong.
No branches or pull requests
当我开启了硬盘缓存,可是我还加了一个元数据获取失败兜底函数,这个时候只会走硬盘缓存逻辑,兜底函数不生效了
The text was updated successfully, but these errors were encountered: