core: bug fixes

This commit is contained in:
undefined committed 2022-10-06 02:53:22 +08:00
1 parent 5d340608db
commit 2daa7e2034
11 files changed
+36 -34

No files matched your search

+2 -1
View File
@@ -9,6 +9,7 @@ import { Context } from '../context';
import i18n from '../lib/i18n';
import { Logger } from '../logger';
import * as bus from '../service/bus';
import { unwrapExports } from '../utils';
const logger = new Logger('common');
@@ -37,7 +38,7 @@ const getLoader = (type: LoadTask, filename: string) => async function loader(pe
const p = locateFile(i, [`${filename}.ts`, `${filename}.js`]);
if (p && !fail.includes(i)) {
try {
const m = require(p);
const m = unwrapExports(require(p));
if (m.apply) ctx.loader.reloadPlugin(ctx, p, {});
else logger.info(`${type.replace(/^(.)/, (t) => t.toUpperCase())} init: %s`, i);
} catch (e) {