🐛 #215,#237

This commit is contained in:
muwoo
2023-09-22 10:08:27 +08:00
parent b94d725d69
commit 79e39018fd
3 changed files with 52 additions and 19 deletions

View File

@@ -9,17 +9,23 @@ export default () => {
let systemPlugins = totalPlugins.filter(
(plugin) => plugin.pluginType === 'system'
);
systemPlugins = systemPlugins.map((plugin) => {
const pluginPath = path.resolve(
PLUGIN_INSTALL_DIR,
'node_modules',
plugin.name
);
return {
...plugin,
indexPath: path.join(pluginPath, './', plugin.entry),
};
});
systemPlugins = systemPlugins
.map((plugin) => {
try {
const pluginPath = path.resolve(
PLUGIN_INSTALL_DIR,
'node_modules',
plugin.name
);
return {
...plugin,
indexPath: path.join(pluginPath, './', plugin.entry),
};
} catch (e) {
return false;
}
})
.filter(Boolean);
const hooks = {
onReady: [],