core: export metrics with tx2

This commit is contained in:
undefined committed 2021-09-15 18:11:43 +08:00
1 parent 14df7d7a05
commit 7f25778671
5 files changed
+21 -9

No files matched your search

+5 -4
View File
@@ -34,16 +34,17 @@ export function addon(addonPath: string, prepend = false) {
global.publicDirs[prepend ? 'push' : 'unshift'](publicPath);
const targets = fs.readdirSync(publicPath);
for (const target of targets) {
if (global.ui.manifest[target] && !prepend) {
global.ui.manifest[target] = publicPath;
} else if (!global.staticFiles[target]) {
global.ui.manifest[target] = publicPath;
if (global.Hydro.ui.manifest[target] && !prepend) {
global.Hydro.ui.manifest[target] = publicPath;
} else if (!global.Hydro.ui.manifest[target]) {
global.Hydro.ui.manifest[target] = publicPath;
}
}
}
global.addons[prepend ? 'unshift' : 'push'](modulePath);
} catch (e) {
logger.error(`Addon not found: ${addonPath}`);
logger.error(e);
}
} else logger.error(`Addon not found: ${addonPath}`);
}