@blocklet/pages-kit 0.5.52 → 0.5.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -326,6 +326,11 @@ function usePreloadComponent({ instanceId, componentId, properties, locale, dev
|
|
|
326
326
|
previousRef.current = result;
|
|
327
327
|
return result;
|
|
328
328
|
}
|
|
329
|
+
const isProduction = dev?.mode === 'production';
|
|
330
|
+
// 在 production 模式下,如果前置 preload 已经触发过了,直接返回,不再触发下面的 /preload 逻辑
|
|
331
|
+
if (isProduction && previousRef.current) {
|
|
332
|
+
return previousRef.current;
|
|
333
|
+
}
|
|
329
334
|
if (instanceId) {
|
|
330
335
|
const key = [instanceId, realLocale].join('-');
|
|
331
336
|
COMPONENT_LOADER_MAP[key] ??= (0, exports.customComponentStates)()
|