1
0
mirror of synced 2026-04-14 21:19:18 +08:00

feat(cli,data-source,runtime): 数据源支持动态按需加载

This commit is contained in:
roymondchen
2024-04-12 16:52:58 +08:00
parent 872c978b9b
commit 006133102f
11 changed files with 83 additions and 36 deletions

View File

@@ -22,6 +22,13 @@ export const prepareEntryFile = async (app: App) => {
'value-entry': generateContent(useTs, EntryType.VALUE, moduleMainFilePath.valueMap),
'event-entry': generateContent(useTs, EntryType.EVENT, moduleMainFilePath.eventMap),
'datasource-entry': generateContent(useTs, EntryType.DATASOURCE, moduleMainFilePath.datasourceMap),
'async-datasource-entry': generateContent(
useTs,
EntryType.DATASOURCE,
moduleMainFilePath.datasourceMap,
'',
dynamicImport,
),
'ds-config-entry': generateContent(useTs, EntryType.DS_CONFIG, moduleMainFilePath.dsConfigMap),
'ds-value-entry': generateContent(useTs, EntryType.DS_VALUE, moduleMainFilePath.dsValueMap),
'ds-event-entry': generateContent(useTs, EntryType.DS_EVENT, moduleMainFilePath.dsEventMap),
@@ -43,7 +50,7 @@ export const prepareEntryFile = async (app: App) => {
});
};
const generateContent = (
export const generateContent = (
useTs: boolean,
type: EntryType,
map: Record<string, string> = {},