|
|
|
|
@ -67,14 +67,12 @@ export let packagesList: PackagesType = {
|
|
|
|
|
const componentCacheMap = new Map<string, any>();
|
|
|
|
|
const loadConfig = (packageName: string, categoryName: string, keyName: string) => {
|
|
|
|
|
const key = packageName + categoryName + keyName;
|
|
|
|
|
console.log('loadConfig', key);
|
|
|
|
|
if (!componentCacheMap.has(key)) {
|
|
|
|
|
componentCacheMap.set(
|
|
|
|
|
key,
|
|
|
|
|
import(`./components/${packageName}/${categoryName}/${keyName}/config.ts`),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
console.log('loadConfig', componentCacheMap.get(key));
|
|
|
|
|
return componentCacheMap.get(key);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -91,7 +89,6 @@ export const createComponent = async (targetData: ConfigType) => {
|
|
|
|
|
return new redirectChart.default();
|
|
|
|
|
}
|
|
|
|
|
const chart = await loadConfig(targetData.package, category, key);
|
|
|
|
|
console.log('chart', chart);
|
|
|
|
|
return new chart.default();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|