fix: prefer source mod

This commit is contained in:
cha0s 2020-12-07 06:20:30 -06:00
parent 23bfb384fc
commit 3252f681a3
2 changed files with 8 additions and 6 deletions

View File

@ -12,11 +12,12 @@ const r = eval('require');
const config = readConfig();
const paths = Object.entries(config).map(([plugin]) => {
try {
r.resolve(plugin);
return plugin;
const local = join(process.cwd(), 'src', plugin);
r.resolve(local);
return local;
}
catch (error) {
return join(process.cwd(), plugin);
return plugin;
}
});
const latus = new Latus({

View File

@ -11,11 +11,12 @@ module.exports = new Promise(async (resolve, reject) => {
const config = readConfig();
const paths = Object.entries(config).map(([plugin]) => {
try {
require.resolve(plugin);
return plugin;
const local = join(process.cwd(), 'src', plugin);
require.resolve(local);
return local;
}
catch (error) {
return join(process.cwd(), plugin);
return plugin;
}
});
const latus = new Latus({