mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 08:29:20 +08:00
refactor: 修改结构 功能动态从后端获取
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* 远程功能包入口(IIFE 构建)。
|
||||
* 当前阶段导出元数据;真正 UI 仍由壳内 embedded 模块挂载。
|
||||
* 后续可将 FloatingPanel 整包打入此入口并在 main world 执行。
|
||||
*/
|
||||
const FEATURE_ID = 'pdd-ad-fee';
|
||||
|
||||
export interface RemoteFeatureExport {
|
||||
id: string;
|
||||
version: string;
|
||||
executionWorld: 'extension';
|
||||
}
|
||||
|
||||
const meta: RemoteFeatureExport = {
|
||||
id: FEATURE_ID,
|
||||
version: '0.1.0',
|
||||
executionWorld: 'extension',
|
||||
};
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__ECBI_FEATURES__?: Record<string, RemoteFeatureExport>;
|
||||
}
|
||||
}
|
||||
|
||||
const g = globalThis as typeof globalThis & {
|
||||
__ECBI_FEATURES__?: Record<string, RemoteFeatureExport>;
|
||||
};
|
||||
g.__ECBI_FEATURES__ = g.__ECBI_FEATURES__ ?? {};
|
||||
g.__ECBI_FEATURES__[FEATURE_ID] = meta;
|
||||
|
||||
export default meta;
|
||||
Reference in New Issue
Block a user